[cairo] glitz API changes
David Reveman
c99drn at cs.umu.se
Tue May 18 11:23:12 PDT 2004
Some important changes to the glitz API.
OLD:
glitz_surface_flush (surface, x, y, width, height):
was used for swapping buffers for double buffered surfaces and flush
rendering operations for single buffered surfaces. By specifying an area
not equal to the complete surface, you could make glitz copy the pixels
of the back buffer to the front buffer instead of swapping buffers.
NEW:
glitz_surface_flush (surface):
Only flush rendering operations (a simple glFlush)
glitz_surface_swap_buffers (surface):
Swap buffers for double buffered surfaces. Nothing for single buffered
surfaces.
glitz_surface_set_read_buffer (surface, buffer):
glitz_surface_set_draw_buffer (surface, buffer):
These two functions allow the application to control the read and draw
buffer of a surface. This effects all glitz drawing operations. Adding
stereo surface support to glitz should now be quite easy.
glitz_copy_area (src_surface,
dst_surface,
x_src, y_src,
width, height,
x_dst, y_dst):
This function can not only be used for copying pixels between different
surfaces, it can also be used for copying pixels within a surface and by
first setting the draw buffer to "front" this function can copy pixels
from the back buffer of a surface to the front buffer.
RESULT:
This change to the glitz API gives the application much better control
over double buffered surfaces and flushing of rendering operations.
My OpenGL backend versions of the cairo demos (cairo-demo.c and
cairo-knockout.c) has been updated to use these new glitz functions for
efficient double buffering (no redrawing on Expose events, only
glitz_copy_area calls).
OpenGL cairo-demos:
http://www.cs.umu.se/~c99drn/cairo-demos-shading-glx.tar.gz
-David
More information about the cairo
mailing list