[cairo] Memory usage in OpenGL Cairo UI
chris at chris-wilson.co.uk
Tue Oct 20 01:39:20 PDT 2009
Excerpts from Stephen Gentle's message of Tue Oct 20 09:18:18 +0100 2009:
> > On Mon, Oct 19, 2009 at 9:39 PM, Stephen Gentle
> > <stephen at stephengentle.com> wrote:
> >> 2. I use only one surface and have all the controls draw directly onto that
> Do you think this is the best way to go then?
Yes. Track the damage extents (probably best as a region, or a set of
non-overlapping rectangles) and use TexSubImage to download the dirty
pixels to your texture. (Alas, damage tracking is not part of the cairo
In the near future, the cairo-gl backend will have matured sufficiently
that you will be able to use cairo to render into the texture or
framebuffer directly (with the premise of full GPU acceleration) which
will eliminate the need for the additional temporary storage and
management on your part. With rendering via the GPU (be it direct or via
XRender, though here you depend upon mature drivers and lack of
pre-emption from other clients) there is a significant advantage to
maintaining a single target buffer, again favouring the second option.
Hope this helps, and you are having fun using Cairo!
Chris Wilson, Intel Open Source Technology Centre
More information about the cairo