Merge branch 'master' into 1.0-integration

* master:
  [cogl-vertex-buffer] Ensure the clip state before rendering
  [test-text-perf] Small fix-ups
  Add a test for text performance
  [build] Ensure that cogl-debug is disabled by default
  [build] The cogl GE macro wasn't passing an int according to the format string
  Use the right internal format for GL_ARB_texture_rectangle
  [actor_paint] Ensure painting is a NOP for actors with opacity = 0
  Make backface culling work with vertex buffers
This commit is contained in:
Emmanuele Bassi 2009-05-22 12:00:33 +01:00
commit 3db47a8da3
3 changed files with 11 additions and 3 deletions

View File

@ -325,9 +325,9 @@ void cogl_enable_depth_test (gboolean setting);
* *
* Sets whether textures positioned so that their backface is showing * Sets whether textures positioned so that their backface is showing
* should be hidden. This can be used to efficiently draw two-sided * should be hidden. This can be used to efficiently draw two-sided
* textures or fully closed cubes without enabling depth testing. Only * textures or fully closed cubes without enabling depth testing. This
* calls to cogl_texture_rectangle() and cogl_texture_polygon() are * only affects calls to the cogl_rectangle* family of functions and
* affected. Backface culling is disabled by default. * cogl_vertex_buffer_draw*. Backface culling is disabled by default.
*/ */
void cogl_enable_backface_culling (gboolean setting); void cogl_enable_backface_culling (gboolean setting);

View File

@ -62,6 +62,7 @@ const gchar *cogl_gl_error_to_string (GLenum error_code);
{ \ { \
g_warning ("%s: GL error (%d): %s\n", \ g_warning ("%s: GL error (%d): %s\n", \
G_STRLOC, \ G_STRLOC, \
__err, \
cogl_gl_error_to_string (__err)); \ cogl_gl_error_to_string (__err)); \
} } G_STMT_END } } G_STMT_END

View File

@ -1647,6 +1647,9 @@ enable_state_for_drawing_buffer (CoglVertexBuffer *buffer)
enable_flags |= cogl_material_get_cogl_enable_flags (ctx->source_material); enable_flags |= cogl_material_get_cogl_enable_flags (ctx->source_material);
if (ctx->enable_backface_culling)
enable_flags |= COGL_ENABLE_BACKFACE_CULLING;
cogl_enable (enable_flags); cogl_enable (enable_flags);
} }
@ -1723,6 +1726,8 @@ cogl_vertex_buffer_draw (CoglHandle handle,
if (!cogl_is_vertex_buffer (handle)) if (!cogl_is_vertex_buffer (handle))
return; return;
cogl_clip_ensure ();
buffer = _cogl_vertex_buffer_pointer_from_handle (handle); buffer = _cogl_vertex_buffer_pointer_from_handle (handle);
enable_state_for_drawing_buffer (buffer); enable_state_for_drawing_buffer (buffer);
@ -1751,6 +1756,8 @@ cogl_vertex_buffer_draw_elements (CoglHandle handle,
if (!cogl_is_vertex_buffer (handle)) if (!cogl_is_vertex_buffer (handle))
return; return;
cogl_clip_ensure ();
buffer = _cogl_vertex_buffer_pointer_from_handle (handle); buffer = _cogl_vertex_buffer_pointer_from_handle (handle);
enable_state_for_drawing_buffer (buffer); enable_state_for_drawing_buffer (buffer);