[Pixman] [PATCH 4/8] Better support for NONE repeat in nearest scaling main loop template

Soeren Sandmann sandmann at cs.au.dk
Thu Feb 10 02:12:41 PST 2011


Siarhei Siamashka <siarhei.siamashka at gmail.com> writes:

> From: Siarhei Siamashka <siarhei.siamashka at nokia.com>
> 
> Scaling function now gets an extra boolean argument, which is set
> to TRUE when we are fetching padding pixels for NONE repeat. This
> allows to make a decision whether to interpret alpha as 0xFF or 0x00
> for such pixels when working with formats which don't have alpha
> channel (for example x8r8g8b8 and r5g6b5).

Another way to do this would be to clip away zeros up front for source
images. For example, a new function pointer could be added to the
image struct:

        clip_zeros (pixman_image_t *image, pixman_region_t *region)

that would clip away those parts of region where the image is known to
be zero. Then, in pixman.c, this function could be called for both
source and mask if the operator was one where zeros had no effect.

That would benefit all operations and avoid cluttering these
macros. It would also cause the SAMPLES_COVER_CLIP to be set in more
cases.

I'm fine with this patch as is too though.


Soren


More information about the Pixman mailing list