[cairo] How to efficiently clear a surface

Bill Spitzak spitzak at d2.com
Tue Aug 24 14:45:11 PDT 2004

On Monday 16 August 2004 12:12 pm, Carl Worth wrote:

> One option would be to notice when the user is filling a path that is
> pixel-aligned rectangle and then be sure to use a more accellerated path
> for the fill. We already have the rectangle detection code for our fast
> clipping path, so this should be easy to hook up.
> Another option, (that I don't like as much), is to add a call for
> filling a rectangle, separate from the general path-based
> cairo_fill. PostScript has such an operator, rectfill, but it always
> seemed like a wart in the API to me.

What happened to "add a rectangle to the current path" as an interface? It 
seems to me that that is a very good solution. I'm a bit worried that 
"detecting rectangles" may unnecessarily slow down paths that are not 
rectangles, while this should avoid any detection time at all and also halves 
the number of arguments sent.

More information about the cairo mailing list