[cairo] show_surface not showing my surface

Jonathan Roewen jonathan.roewen at gmail.com
Mon May 2 23:29:22 PDT 2005


Argh, sometimes cairo API (0.4) is so esoteric.

Here's what I'm doing:

Have a layer, has a cairo_t, x, y, width, height.

I create a new layer like:
layer.cr = cairo_create ();
layer.x = x;
layer.y = y;
layer.w = w;
layer.h = h;

surface = cairo_image_surface_create (FORMAT_ARGB32, layer.w. layer.h);
cairo_set_target_image (layer.cr, surface);

Note, my C translation may be a little off ;-)

Then, I draw into the layer like normal.... and then I want to render
a whole bunch of layers in one go to my primary cairo_t object.

Something like:
cairo_show_surface cairo (cairo_current_target_surface (layer.cr))
layer.w layer.h;

where cairo is the primary surface.

Now, I get nothing at all, but I render a rectangle after applying the
above to each layer (which shows up fine), so I know no exceptions are
being generated (using ocaml wrapper).

I really need to get this working somehow, so I can make my API.

Jonathan



More information about the cairo mailing list