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

Soeren Sandmann sandmann at daimi.au.dk
Sat Jun 3 20:53:09 PDT 2006


Leon Woestenberg <leonw at mailcan.com> writes:

> Given I render to 1920x1080x32 to video memory, that's exactly why I
> asked about querying cairo for a dirty region. I will probably be
> doing many things in a image back buffer for the exact same bandwidth
> problem.

If you have enough memory, you can speed up your application
enormously by keeping a 'shadow' framebuffer of the same size in main
memory, then copying from that into the video memory. Writing to video
memory is not nearly as slow as reading.

> This thread has run off in a different direction considering
> optimization of performance of the software above the interface (I am
> aware there is much to be done there, but it is irrelevant to what I
> asked) and X (which is not what I use). My aim was to see if the
> software above (mostly cairo) allows me to query what has to be put
> through the interface.

If cairo had API to retrieve a relatively tight coverage of the fills
and strokes of the current path, then you could keep track of the
dirty region yourself. Everytime fill or stroke anything, you retrieve
the coverage and add to a dirty region. Then when you are done, you
can blit the dirty region to the framebuffer.


Soren


More information about the cairo mailing list