[cairo] GSoC: Scan converting rasteriser update
Jeff Muizelaar
jeff at infidigm.net
Mon Nov 10 10:17:23 PST 2008
On Mon, Nov 10, 2008 at 08:07:28PM +0200, M Joonas Pihlaja wrote:
>
> 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.
Yep. You're right it look the span code is good.
> 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.
I assume you mean "classified as bounded-by-mask"?
I suppose we could do something like the following in the image surface
if (self->op == CAIRO_OPERATOR_SOURCE || !_cairo_operator_bounded_by_mask (self->op)) {
_cairo_surface_composite_shape_fixup_unbounded()
}
but that seems like a bad hack. Either way, solving this isn't merge
critical.
-Jeff
More information about the cairo
mailing list