[cairo] recursive quad-tree, or bounding box of changed area during drawing?

Leon Woestenberg leonw at mailcan.com
Thu Jun 1 12:35:48 PDT 2006


Hello,

thanks for your answers.

Soeren Sandmann wrote:
> Federico Mena Quintero <federico at ximian.com> writes:
> <...>
>   
It is very interesting to read about canvas (retained mode) 
optimizations, but I am using cairo (direct mode) where I have no notion 
of paint objects. I start painting, stop painting, and want to know if I 
can get a cheap bounded box (or a recursive variant thereof) of the 
region being dirtied in the paint process.

> In my opinion, adding to cairo the ability to rasterize to "fat"
> pixels, is the best compromise between code bloat and repaint
> efficiency, especially if rasterizing to fat pixels can be just a
> matter of 
>
>         - tesselating to trapezoids (which cairo needs to do anyway)
>
>         - computing which fat pixels are touched by the bounding box
>           of each trapezoid (a trivial computation).
>   
I am not sure what you mean by fat pixels, but one approach for a 
bounding box approach would be to remember the lowest and highest x and 
y coords of the generated trapezoids. I was just wondering if there is a 
smarter approach than that.

Regards,

Leon.


More information about the cairo mailing list