Render spec clarification

Kamalneet Singh kamalneet.s at samsung.com
Mon Oct 13 23:33:25 PDT 2008


Adam Jackson wrote:
> Right now Render is sort of vaguely defined when any of (src, mask, dst)
> point to the same underlying drawable.  This is not necessarily just
> when they're all the same Picture, although that's certainly a special
> case.
> 
> I'd like to have this clarified, since otherwise it becomes essentially
> impossible for something like shatter to do the right thing,
> particularly in the face of transforms.  Anholt pointed out a legitimate
> use of (src IN src OP dst), which is to coerce src to premultiplied
> alpha.  So I think the only thing we need to clarify is when dst is the
> same drawable as one of the other operands.
> 
> I can think of two possible resolutions, and I don't care particularly
> strongly about which one we go with, but I'll throw them both out for
> discussion:
> 
>     Option A: mask==dst and src==dst are just not allowed, and we throw
>     BadMatch


I think it will cause cairo's "self-copy" test to fail. There may be
cairo or X applications out there which may rely on that functionality.
And src=dst  is not a problem unless the regions intersect. So there is
no reason to fire a BadMatch in that case. I think we can just say "If
the src region, after transformation, intersects the destination region,
the results of Composite are undefined".  ..apart from whatever you plan
to do for scrolling.. :)

Specifications do occasionally say that results are undefined  :)

~kammal



More information about the xorg mailing list