cogl-primitives: Copy across the texture coordinates if no texture

Previously when using the cogl_rectangle_* family of functions with a
pipeline that doesn't have a texture for a particular layer then
validate_tex_coords_cb would bail out immediately leaving the texture
coords for that layer uninitialised. This patch changes it so that it
bails out after copying in the texture coordinates instead. This was
causing problems for pipelines that were trying to completely generate
the texture values in a CoglSnippet because they wouldn't get any
texture coordinates.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
This commit is contained in:
Neil Roberts 2012-02-08 15:58:07 +00:00
parent 15d43bb697
commit 88f8780367

View File

@ -308,12 +308,6 @@ validate_tex_coords_cb (CoglPipeline *pipeline,
state->i++;
texture = cogl_pipeline_get_layer_texture (pipeline, layer_index);
/* NB: NULL textures are handled by _cogl_pipeline_flush_gl_state */
if (!texture)
return TRUE;
/* FIXME: we should be able to avoid this copying when no
* transform is required by the texture backend and the user
* has supplied enough coordinates for all the layers.
@ -330,6 +324,12 @@ validate_tex_coords_cb (CoglPipeline *pipeline,
memcpy (out_tex_coords, in_tex_coords, sizeof (float) * 4);
texture = cogl_pipeline_get_layer_texture (pipeline, layer_index);
/* NB: NULL textures are handled by _cogl_pipeline_flush_gl_state */
if (!texture)
return TRUE;
/* Convert the texture coordinates to GL.
*/
transform_result =