[cairo] rendering to image, then to X11 display

Tamas K Papp tpapp at Princeton.EDU
Sun Sep 2 06:23:39 PDT 2007


I am getting tired of debugging my double buffered code for X11: I
tried following Carl's suggestions and started to use Xtrace, but the
whole thing is getting arcane and beyond my abilities.  For example,
lately I found out that trying to stoke a path with more than approx
10000 segments will kill the X connection with

* X connection to :0.0 broken (explicit kill or server shutdown).

Yes, I could work around it, but I found that I am spending a lot of
time on debugging X11 or related code with little return.  

So I guess it is time to try something else.  Experience tells me that
the image backend is very robust, so I thought of the following: I
would open an image surface, render my image in memory, then display
the whole thing on the window when it is exposed.  

Is this feasible? 

Given a Cairo image surface, an X11 display and window descriptor,
what is the preferred way of displaying it on screen?  I will only be
working with RGB surfaces, BTW.  If this is difficult, examples and
pointers would be appreciated.



More information about the cairo mailing list