[cairo] GSoC: Scan converting rasteriser update

M Joonas Pihlaja jpihlaja at cc.helsinki.fi
Mon Nov 10 10:07:28 PST 2008


On Mon, 10 Nov 2008, Jeff Muizelaar wrote:

>>> - can we use SRC to an unitialized surface instead of initializing a
>>> surface
>>> and then doing ADD?
>>
>> Uninitialised surfaces wouldn't work since SOURCE is defined to
>> be bounded by the mask.  Can we add an unbounded SOURCE at some
>> point to cairo?
>
> Cairo's SOURCE is bounded by the mask; however, pixman SOURCE is not.
> If you change it to SOURCE it should just work, but it isn't necessarily
> the right thing to do because we're sort of lying about the semantics of
> SOURCE. I'm not really sure what the right thing to do here is. It also
> makes me wonder: does the span code bound the SOURCE operator? I had a
> quick look and it looks like it doesn't.

The span code doesn't bound the SOURCE operator because the 
bounded semantics of SOURCE are implemented by
cairo-surface-fallback.c's _clip_and_composite_source().  Most 
SOURCE compositing goes via that path for all backends I think.

The reason why switching to SOURCE doesn't just work is that the 
way the span code treats all boundedness is via the same 
"unbounded shape fixup" idiom that all the other compositing code 
in cairo does: First do the compositing in the bounding rectangle 
of the mask and then if the op is unbounded by source, clear the 
areas outside of the bounding rectangle.  Since SOURCE is 
classified as bounded-by-source this results in a sort of 
semi-bounded-SOURCE semantics for SOURCE. saucy source.

This saves cycles for all cases except where we really do want a 
real unbounded SOURCE resulting in odd looking hacks like the 
clear then ADD thing. :|

Joonas


More information about the cairo mailing list