hi;

On 21 June 2012 21:19, Vivien Malerba <vmale...@gmail.com> wrote:
> I have a project using GooCanvas at the moment and was considering the idea
> of using Clutter instead. The only thing which bothers me at the moment is
> that using GooCanvas I can request the canvas to be rendered to a specific
> cairo context (cairo_t type), which allows me to export to an SVG file, a
> PNG file or even print a diagram (using GtkPrintOperation and related).
>
> Is there any possibility to do the same with clutter (i.e. draw a clutter
> actor or stage to a specific cairo_t context)?

not really, no; unlike GooCanvas, Clutter does not use Cairo to render
its scene graph, so you cannot simply create a cairo_surface_t or a
cairo_t and point Clutter in its direction.

you may be able to render a complex Actor to an offscreen buffer, and
then take the contents of the buffer from the GPU and place them into
an image surface; you could also use clutter_stage_read_pixels() to
read back the contents of the Stage after it has been painted (using a
repaint function) and then place them into an image surface. reading
back data from the GPU is not extremely cheap, especially if you're
reading back large chunks of data. obviously, this would also mean
that what you get are the contents of the screen, and you don't get to
display them differently depending on the rendering target - nor that
primitives will get serialised to Cairo commands, except "put image
data at these coordinates".

ciao,
 Emmanuele.

-- 
W: http://www.emmanuelebassi.name
B: http://blogs.gnome.org/ebassi/
_______________________________________________
clutter-app-devel-list mailing list
clutter-app-devel-list@clutter-project.org
http://lists.clutter-project.org/listinfo/clutter-app-devel-list

Reply via email to