[cairo] default rendering engine
acjgenius at earthlink.net
Mon May 3 12:47:18 PDT 2004
On Mon, 2004-05-03 at 14:29, Bill Spitzak wrote:
> One thing I have found is that I *cannot* reuse contexts at all. It appears
> that you cannot call cairo_set_target_drawable more than once on a given
> surface, even for the same drawable. It always crashes. Also if the window
> changes size, it crashes the entire X server.
I have absolutely no such issues(using current CVS). I have recently
tested using a cache of 8 cairo contexts, which I use as needed and I am
constantly setting different drawables on them, sometimes the same one
sometimes not. And I am testing this within a constantly changing
environment and window resizes have yet to affect it.
I would presume its not the setting of the target by itself but
something else you are performing on the canvas. In which case I would
definitely consider a bug.
> Also, like many other libraries, it is very unclear if I should be wasting
> time and effort avoiding the construction/destruction of these context
> objects. In fact it may be cheaper to call this a lot than the memory used to
> keep a context around. Can anybody explain the expected use of Cairo for
> multiple windows?
I have found that one of the biggest slow ups in a constantly redrawing
multiple objects is the actual creation of the contexts. So yes I think
for high overhead its critical to be able to use a cache of them and
only create additional ones when absolutely needed.
More information about the cairo