[cairo] CAIRO_OPERATOR_SOURCE not handled by backend
jeff at infidigm.net
Tue Mar 20 11:55:14 PDT 2007
On Tue, Mar 20, 2007 at 07:18:13PM +0100, Sebastian Tusk wrote:
> > The reason for the special behaviour is that when SOURCE or CLEAR are used
> > with
> > a mask in cairo that mask bounds the operation. Does your backend
> > support this behaviour?
> The special behaviour is triggered even without a mask. For my backend I would handle both cases myself.
This isn't true. Without a mask (clip_surface) the special case in
clip_and_composite_trapezoids will send the operation through to
_composite_trap_region which passes the SOURCE operation on to the
backend composite function through _cairo_surface_composite.
> > Either way _clip_and_composite should probably
> > be changed to try to do the operation and the backends that don't
> > support it should return STATUS_UNSUPPORTED. Only then, should cairo
> > fallback to trying (src IN mask IN clip) ADD (dst OUT (mask IN clip)).
> This means a change to all of the existing backends too? I will do that if there is no easier way.
Yes, that's probably what you'll have to do.
> > > Shouldn't most backends be able to do the SOURCE operator more
> > efficently than the current way?
> > XRender can not. I am not sure about the other backends, though I think
> > Quartz (at least newer ones) might be able to do it more efficiently.
> Is this an API limitation?
Of XRender? Not really an API limitation, it's just a semantic mismatch.
The SOURCE operator is not bounded by the mask in XRender.
More information about the cairo