[cairo] Cairo SkyOS backend
Daniel Amelang
daniel.amelang at gmail.com
Tue Nov 28 11:35:01 PST 2006
On 11/28/06, Robert Szeleney <skyos at liwest.at> wrote:
> Hi!
>
> Does anyone have an answer to these questions?
>
> skyos at liwest.at wrote:
> > Hi!
> >
> > I'm in the middle of making a SkyOS backend for cairo-1.2.0 which works quite nice already. (at least according to the cairo test suite).
> >
> > Anyway, I hope you can answer me a few technical questions regarding the recommended communication between cairo and the native window system.
> >
> > 1.
> > Using a "cairo_skyos_surface_create" function the SkyOS backend establishes a "connection" between a cairo surface and a native window. (Similar to the other backends).
> >
> > The cairo_skyos_surface_create allocates a memory buffer with the same size as the current window content and copies the current window content into this buffer.
> > When now cairo draws into this buffer, how is the content supposed to get "on screen" again? (SkyOS internally double buffers all drawing functions, so as long as no GI_SwapWindow is called nothing will be displayed). Is this call to the swap function supposed to be somewhere in the cairo/SkyOS backend or is the application using cairo responsible for handling this?
> >
> > For instance, in order to make the cairo-test.c display content on the screen I had to insert a GI_SwapWindow right before terminating the test/releasing the surface.
I'm no backend developer for cairo, but since no one else is jumping
in, I'll say something, even if I'm dead wrong :)
I think you'll find the answer to this question (and perhaps others)
in cairo-quartz-surface.c. This is an example of a surface that uses
the cairo-fallback surface to do all the work, and then calls
CGContextDrawImage to draw the result onto the screen. You'll notice
that it does this in the surface_release_dest_image function, which is
where I imagine you'll need to call GI_SwapWindow.
Dan
More information about the cairo
mailing list