From 88f8780367311ff23479352d887048c2f08c7ffd Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Wed, 8 Feb 2012 15:58:07 +0000 Subject: [PATCH] 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 --- cogl/cogl-primitives.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cogl/cogl-primitives.c b/cogl/cogl-primitives.c index aca9c20cd..4a4091634 100644 --- a/cogl/cogl-primitives.c +++ b/cogl/cogl-primitives.c @@ -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 =