[cairo] 29e22cf38e8abc54b9dddbdeb3909d02866a82a0 - Enable component alpha on solid mask
Soeren Sandmann
sandmann at daimi.au.dk
Mon Sep 14 05:59:12 PDT 2009
chris <chris at chris-wilson.co.uk> writes:
> > Thanks for adding the new test from rendercheck. That is going to be
> > useful. Most of the other commits look good too, but I don't
> > understand the component-alpha-on-solid-mask one:
>
> [snip]
>
> > Is there any reason to believe that anyone would actually do this? It
> > doesn't seem useful to me. And if we are going to support component
> > alpha on solid images, shouldn't it also be supported on gradients?
>
> Interesting. As I read pixman (and the other ddx) they do not
> distinguish between a solid pattern and 1x1R image, in particular the
> misleading mask_is_solid(). As such, I thought that not enabling
> component alpha along that path was a simple oversight. At the moment I
> know of no users of solids, though I am contemplating enabling support
> through cairo-xlib (though I hesitate since it requires ddx support in
> order to not regress horribly).
Well, 1x1R has well-defined semantics: it's a repeating 1x1 image, and
to the extent we treat it as a solid, that's an optimization that can
only be done to the extent that the semantics match.
This is in fact the reason many of the fast paths have PIXMAN_a8 as
the mask format along with a NEED_SOLID_MASK flag instead of the more
natural PIXMAN_solid: We can only take those fast paths if the format
is really a8 and not a repeating 1x1 a8r8g8b8 with component alpha.
I agree that it's a confusing mess. I have some cleanups and
optimizations for the whole fast path handling in the no-flags branch
here:
http://cgit.freedesktop.org/~sandmann/pixman/log/?h=no-flags
but it's not ready to go in yet.
> As far as a consistent API goes that I would say we should respect
> component alpha on a mask regardless of type.
I think I agree that it should be supported for all image types,
including BITS images without rgb channels (even though that really is
thoroughly useless given how Render specifies conversion from A to
ARGB).
> And I feel we should also discuss adding a
> cairo_pattern_set_per_component_mask().
Subpixel antialiased geometry is certainly an interesting feature,
though I don't necessarily think that Render's way of specifying it is
the right approach.
Soren
More information about the cairo
mailing list