mirror of
https://github.com/brl/mutter.git
synced 2024-11-29 19:40:43 -05:00
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:
parent
15d43bb697
commit
88f8780367
@ -308,12 +308,6 @@ validate_tex_coords_cb (CoglPipeline *pipeline,
|
|||||||
|
|
||||||
state->i++;
|
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
|
/* FIXME: we should be able to avoid this copying when no
|
||||||
* transform is required by the texture backend and the user
|
* transform is required by the texture backend and the user
|
||||||
* has supplied enough coordinates for all the layers.
|
* 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);
|
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.
|
/* Convert the texture coordinates to GL.
|
||||||
*/
|
*/
|
||||||
transform_result =
|
transform_result =
|
||||||
|
Loading…
Reference in New Issue
Block a user