[cairo] CSS/SVG filter effects

Carl Worth cworth at cworth.org
Mon Nov 1 14:03:59 PST 2004


On Mon, 01 Nov 2004 15:26:05 -0500, "Robert O'Callahan" wrote:
> Currently it appears that the temporary buffer should be an image 
> surface and we have to figure out a size and resolution for it. Correct?

Currently, yes.

But I'd like to add an interface so that users could create intermediate
surfaces without worrying about the type or dimensions. The tricky part
is coming up with the right API for managing this.

We have surface objects available through the various
cairo_foo_surface_create functions. But cairo_scratch_surface_create
would perhaps not make sense as the implicit typing really depends on the
current surface, which is inside the cairo_t* which is not generally
passed to cairo_foo_surface_create.

So we could look at cairo_set_target_scratch but then the problem is how
to give the user a handle on the surface. We had a push_group/pop_group
API at one point that tried to avoid exposing a handle on the
intermediate surface. That failed since the pop_group call did implicit
compositing and it was unclear what the graphics state should be at the
time of the implicit compositing. Also, as you point out, the user will
want to have a good control over the rendering of the intermediate
surface in order to do filtering, etc.

We could just make cairo_set_target_scratch return the handle to the
surface. This would work, but is just a bit inconsistent with the rest
of the set_target_foo functions.

Anyway, I've got a goal to simplify this. Suggestions, as always, are
welcome.

-Carl



More information about the cairo mailing list