clutter-cairo-texture: Fix destroying the old texture
authorNeil Roberts <neil@linux.intel.com>
Fri, 7 May 2010 17:03:39 +0000 (18:03 +0100)
committerNeil Roberts <neil@linux.intel.com>
Fri, 7 May 2010 17:28:46 +0000 (18:28 +0100)
In clutter_cairo_texture_create_region it tries to destroy the old
texture before mapping the PBO by setting the texture on the first
layer of the material to COGL_INVALID_HANDLE. However it was using the
material API incorrectly so it ended up showing a warning and doing
nothing.

clutter/clutter-cairo-texture.c

index ed7a9c1..e7ae1df 100644 (file)
@@ -526,11 +526,7 @@ clutter_cairo_texture_create_region (ClutterCairoTexture *self,
   /* Destroy the existing texture so that the GL driver won't have to
      copy it when we map the PBO */
   if ((material = clutter_texture_get_cogl_material (CLUTTER_TEXTURE (self))))
-    {
-      const GList *layers = cogl_material_get_layers (material);
-      if (layers)
-        cogl_material_set_layer (layers->data, 0, COGL_INVALID_HANDLE);
-    }
+    cogl_material_set_layer (material, 0, COGL_INVALID_HANDLE);
 
   /* Create a surface to render directly to the PBO */
   surface =