From 0e542aa30615353e4279e5ee3ef6430872584c4e Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Thu, 9 Feb 2012 17:22:24 +0000 Subject: [PATCH] clutter-texture: Don't create a dummy texture All of the pipelines used for ClutterTexture actors share a common pipeline ancestor created with cogl_pipeline_copy. Previously this ancestor had a dummy 1x1 texture attached to it so that it would end up with the same state as the child pipelines that will render with a texture. Cogl now has a mechanism to specify that a texture will be used with a pipeline layer without having to create an actual texture. This patch makes it use that to avoid having an unused texture. Reviewed-by: Emmanuele Bassi --- clutter/clutter-texture.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/clutter/clutter-texture.c b/clutter/clutter-texture.c index b8a803525..fc265170a 100644 --- a/clutter/clutter-texture.c +++ b/clutter/clutter-texture.c @@ -1281,14 +1281,13 @@ clutter_texture_init (ClutterTexture *self) if (G_UNLIKELY (texture_template_material == NULL)) { - CoglHandle dummy_tex; - - dummy_tex = cogl_texture_new_with_size (1, 1, COGL_TEXTURE_NO_SLICING, - COGL_PIXEL_FORMAT_RGBA_8888_PRE); + CoglPipeline *pipeline; texture_template_material = cogl_material_new (); - cogl_material_set_layer (texture_template_material, 0, dummy_tex); - cogl_handle_unref (dummy_tex); + pipeline = COGL_PIPELINE (texture_template_material); + cogl_pipeline_set_layer_null_texture (pipeline, + 0, /* layer_index */ + COGL_TEXTURE_TYPE_2D); } g_assert (texture_template_material != NULL);