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 <ebassi@linux.intel.com>
This commit is contained in:
Neil Roberts 2012-02-09 17:22:24 +00:00
parent f861c788c9
commit 0e542aa306

View File

@ -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);