surface



I have successfully made new canvas items, all subclassed from simple
item. One of these items has a fairly complex way of drawing in the
paint method as it is depending on external data. So I wonder whether
I can speed up the drawing a bit by rendering to a separate surface.
When the bounds change ie the update method is called, I schedule a
full redraw in the paint method. Otherwise I prefer to paint the
already existing surface back to the cairo_t. For example in case part
of the canvas has been covered by another window.

Is the best way to create a surface myself and then paint the surface
onto the cairo_t? Or can I use cairo_get_target to get the surface?
How does goocanvas work internally, will a canvas item have the same
cairo_t and surface as long as the item exists? Or can they be
different each time the update, paint etc. is called? I have looked in
the source code but could not find out easily.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]