framebuffer: Add cogl_framebuffer draw methods

This adds cogl_framebuffer_ apis for drawing attributes and primitives
that replace corresponding apis that depend on the default CoglContext.
This is part of the on going effort to adapt the Cogl api so it no
longer depends on a global context variable.

All the new drawing functions also take an explicit pipeline argument
since we are also aiming to avoid being a stateful api like Cairo and
OpenGL. Being stateless makes it easier for orthogonal components to
share access to the GPU. Being stateless should also minimize any
impedance miss-match for those wanting to build higher level stateless
apis on top of Cogl.

Note: none of the legacy, global state options such as
cogl_set_depth_test_enabled(), cogl_set_backface_culling_enabled() or
cogl_program_use() are supported by these new drawing apis and if set
will simply be silently ignored.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
This commit is contained in:
Robert Bragg
2012-01-08 02:59:04 +00:00
parent 0365f6cda3
commit 92c3063014
25 changed files with 959 additions and 725 deletions

View File

@@ -237,7 +237,6 @@ cogl_primitive_set_mode
cogl_primitive_set_attributes
cogl_primitive_get_indices
cogl_primitive_set_indices
cogl_primitive_draw
cogl_primitive_copy
CoglPrimitiveAttributeCallback
cogl_primitive_foreach_attribute
@@ -306,15 +305,6 @@ cogl_path_fill
cogl_path_stroke
</SECTION>
<SECTION>
<FILE>cogl-drawing</FILE>
<TITLE>Draw Vertex Attributes</TITLE>
cogl_draw_vertex_attributes
cogl_draw_vertex_attributes_array
cogl_draw_indexed_vertex_attributes
cogl_draw_indexed_vertex_attributes_array
</SECTION>
<SECTION>
<FILE>cogl-texture</FILE>
<TITLE>The Texture Interface</TITLE>
@@ -419,6 +409,13 @@ cogl_framebuffer_set_point_samples_per_pixel
cogl_framebuffer_get_context
cogl_framebuffer_clear
cogl_framebuffer_clear4f
<SUBSECTION>
cogl_framebuffer_draw_primitive
cogl_framebuffer_draw_attributes
cogl_framebuffer_draw_indexed_attributes
<SUBSECTION>
cogl_framebuffer_swap_buffers
cogl_framebuffer_swap_region
cogl_framebuffer_add_swap_buffers_callback