[cairo] virtual surfaces and composition

Enrico Weigelt, metux IT consult enrico.weigelt at gr13.net
Wed Dec 9 10:50:28 PST 2015

On 09.12.2015 19:18, LRN wrote:

>> Does cairo recording surface work for you? Unfortunately cairo
>> recording surface does not have "TRUE" playback though. But as long as
>> all of your operators are CAIRO_OPERATOR_OVER, you should be fine.
> CMIIW, but IME the recording surface draws roughly as fast as your own code
> does. I.e. you will get no speedup by caching drawing of a widget on a
> recording surface.

Assuming the rendering engine and the widgets are on the same host.

Anyways, things like scrolling, resizing, zooming, etc should be
handled entirely by the engine, with minimal widget interaction.

> Image surfaces should work fine and you can create image surfaces that are
> similar to the actual output surface of the display system you are using,
> so they can be composited efficiently (AFAIU).

As long as no zooming is involved, that should be fine. But as soon as
zooming comes into the game, vector-based would be a better option.

> You might want to ask GTK+ developers about their experience in using cairo
> as a backend for a widget toolkit, because that is exactly what they are
> doing (and if your licensing situation allows, you can even borrow somre of
> their code; it's LGPLv2+).

Okay, maybe I'll find some hints there, but the concepts are very

By the way:

does cairo already data structures / operations for describing things
like overlaping and nested windows ?


Enrico Weigelt,
metux IT consulting

More information about the cairo mailing list