[cairo] implems double buffering in Cairo

Alex Vazquez avazquez.dev at gmail.com
Tue Feb 9 20:37:39 UTC 2016


Hi!
i have some tearing in my app. And I think implement a double buffering.
My first idea is have two buffers and 1 cairo_surface but i don know if
it's possible swap  the buffer once the cairo_surface has been created.

Example of idea:
bufs[0] = createBuffer();
bufs[1] = createBuffer();

surface = cairo_image_surface_create_for_data(bufs[0] ,

   CAIRO_FORMAT_RGB24, width, height,

   cairo_format_stride_for_width(CAIRO_FORMAT_RGB24,
   width));
Update().
swap buffers in surface.

Is there some function that I can swap the data of a cairo_surface?
Is there any other alternative to implement double buffering?

Regards!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cairographics.org/archives/cairo/attachments/20160209/558f7202/attachment.html>


More information about the cairo mailing list