using cairo surfaces
- From: Tommi Sakari Uimonen <tuimonen cc hut fi>
- To: gtk-app-devel-list gnome org
- Subject: using cairo surfaces
- Date: Mon, 2 Oct 2006 13:58:37 +0300 (EEST)
Hello. I'm trying to create a custom container widget that holds the child
widgets in a hbox (or scrollarea, after I learn how to use it). The child
widgets are using cairo for the drawing, and so is the container widget.
I want to optimize the container drawing since the child widgets don't always
need complete redrawing.
The child drawing is currently done to the container's cairo surface, which is
passed to each child widget, and childs draw to this surface. Reference to this
surface is stored and I'm using a private variable in the container widget that
keeps track of whether the childs need full redraw or can I use the stored
surface to do quick redraw without the need to call the childs' drawing
functions.
Now, I want the child widgets to have their own surfaces and each child should
handle the "smart drawing". So the child widget decides whether it uses the
previously rendered surface or redraws some parts. The container then just uses
set_source_surface to draw the child at desired position.
What kind of surface I should create in the child widgets and how do I copy it
to the container surface?
I've tried creating image surface, but I guess I was doing something wrong,
because nothing was drawn, or I got segfault. So I still have not found the
right way of doing it. The documentation is lacking examples, so I have
proceeded in "trial and error"-basis, and now I'm kind of stuck.
Tommi
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]