From 855661754653ed1b5b1e0f1bf491f7e360ca5ed0 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Sun, 8 Aug 2010 14:26:45 +0100 Subject: [PATCH] material: unlink old layer from owner when replacing In _cogl_material_layer_pre_change_notify when we see that a layer has dependants and it can't be modified directly then we allocate a new layer. In this case we also have to link the new layer to its required owner. If the immutable layer we copied had the same owner though we weren't unlinking that old layer. --- clutter/cogl/cogl/cogl-material.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clutter/cogl/cogl/cogl-material.c b/clutter/cogl/cogl/cogl-material.c index 85a3ce8ee..8f4e1bd61 100644 --- a/clutter/cogl/cogl/cogl-material.c +++ b/clutter/cogl/cogl/cogl-material.c @@ -1451,6 +1451,8 @@ _cogl_material_layer_pre_change_notify (CoglMaterial *required_owner, layer->owner != required_owner) { CoglMaterialLayer *new = _cogl_material_layer_copy (layer); + if (layer->owner == required_owner) + _cogl_material_remove_layer_difference (required_owner, layer, FALSE); _cogl_material_add_layer_difference (required_owner, new, FALSE); cogl_object_unref (new); layer = new;