[cairo] Re: cairo_show_surface and glitz

David Reveman c99drn at cs.umu.se
Thu Dec 9 17:45:47 PST 2004


On Thu, 2004-12-09 at 07:31 -0800, Alex Dubov wrote:
> Greetings.
> As I continue to struggle with my cairo app, I
> encountered a following problem.
> I want to show a pixmap somewhere on the cairo scene.
> So I want a cairo_surface that contains the needed
> pixmap.
> I did a following progression of calls:
> glitz_pixel_buffer_create //giving it my RGBA pixmap
> glitz_surface_create
> glitz_set_pixels //with a created glitz_buffer and
> format I thought fit
> cairo_glitz_surface_create //with glitz_surface
> 
> Then I wanted to use created cairo_surface as argument
> to cairo_show_surface. As you probably guessed,
> nothing happened. I'm playing around with it, but may
> be you can advise me on the correct procedure.

That should work, and it's probably the most efficient way to do it. If
you can't get it working, just send me an example program and I should
be able to figure out what's wrong.

Another way, which might be a bit easier, is to create an
cairo_image_surface for the image data and then just use that surface as
argument for cairo_show_surface. This will be slow as the image surface
is converted to a glitz surface at every show_surface call, but to avoid
that you can just do a show_surface with the image surface as argument
and the glitz surface as target surface. This should get the image data
into the glitz surface and the glitz surface can then be used as
argument to show_surface.

> 
> It seems, that there is a need in some documentation.
> I'm planning to describe my experience with
> cairo/glitz when I'll finish my app, while currently
> I'm getting into trouble way too often.

yeah, glitz documentation is on my todo list.

-David




More information about the cairo mailing list