[cairo] API Shakeup: cairo_paint

Carl Worth cworth at cworth.org
Tue Apr 19 06:20:46 PDT 2005


On Tue, 15 Feb 2005 17:19:59 -0500, Carl Worth wrote:
> We came up with the following proposal for this operation:
> 
> 	void
> 	cairo_paint (cairo_t *cr);

Here's a patch for this one.

It's rather straightforward. The only new real piece needed is a way
to find the bounds of the rectangle needed for the paint operation,
(eg. the clip extents). So to the generic cairo_surface_t code I made
_cairo_surface_set_clip_region cache the clip extents, and added new
_cairo_surface_get_clip_extents to return them.

Then, if clipping is not in effect, _cairo_surface_get_clip_extents
calls into a new surface->get_extents backend function to get the
current active rectangle of the surface, (it would be a simple size,
but the win32 backend doesn't want to be that simple).

I've attempted code for all existing backends, but I've only tested
the image and xlib surfaces. It would be nice if maintainers of the
other surface types could take a look at the relevant portions of the
patch below.

Oh, and thanks Owen for the rectangle optimization. An earlier version
of this patch did a lot of work to be able to call directly into
surface->fill_rectangles. It's nice to be able to have a much simpler
cairo_fill/cairo_rectangle implementation and trust that the
performance will still be just as good.

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050419/b6e3f4d1/attachment.pgp


More information about the cairo mailing list