[clutter] clutter-texture: Don't create a dummy texture
- From: Neil Roberts <nroberts src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter] clutter-texture: Don't create a dummy texture
- Date: Tue, 14 Feb 2012 12:14:58 +0000 (UTC)
commit 0e542aa30615353e4279e5ee3ef6430872584c4e
Author: Neil Roberts <neil linux intel com>
Date: Thu Feb 9 17:22:24 2012 +0000
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>
clutter/clutter-texture.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/clutter/clutter-texture.c b/clutter/clutter-texture.c
index b8a8035..fc26517 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]