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

Soeren Sandmann sandmann at daimi.au.dk
Mon Oct 26 09:44:51 PDT 2009


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.

> +    { 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,
Soren


More information about the cairo mailing list