[cairo] [PATCH] pixman: C fast path for add_1000_1000 and over_n_1_8888

Siarhei Siamashka siarhei.siamashka at gmail.com
Tue Oct 27 04:25:34 PDT 2009


On Monday 26 October 2009, Soeren Sandmann wrote:
> Hi,
>
> > These two fast path functions dealing with 1-bit data are needed
> > to improve performance of xfce4 terminal. Some other applications
> > may potentially benefit too.
>
> A couple of minor comments:
>
> Can we get the two fast paths enabled in two separate commits to
> facilitate bisecting?
>
> > +static void
> > +fast_composite_over_n_1_8888 (pixman_implementation_t *imp,
> > +                              pixman_op_t              op,
> > +
> > + [...]
> > +	    if (bitcache & bitmask)
> > +		*dst = over (src, *dst);
>
> It would likely be a big win to check whether the alpha channel of the
> source is 0xFF (which is almost always is), then simply writing out
> the source if it is. That would completely avoid reading the
> destination from memory.

A good catch.

> > +    { PIXMAN_OP_OVER, PIXMAN_solid,    PIXMAN_a1,       PIXMAN_a8r8g8b8,
> > fast_composite_over_n_1_8888, 0 }, +    { PIXMAN_OP_OVER, PIXMAN_solid,  
> >  PIXMAN_a1,       PIXMAN_x8r8g8b8, fast_composite_over_n_1_8888, 0 },
>
> I think this one can be enabled for destinations of type x8b8g8r8 and
> a8b8g8r8 as well, since pixman_image_get_solid() takes care of the
> swapping.
>
> Other than those things, it looks good to me.

Thanks for the review.

Patches corrected according to your comments, tested on both big and little
endian systems and pushed to master.

-- 
Best regards,
Siarhei Siamashka
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.cairographics.org/archives/cairo/attachments/20091027/e99ef6ca/attachment.pgp 


More information about the cairo mailing list