[clutter] pipeline: reclaim ownership if reverting to layer ancestor



commit e625be6c96a1274e4978bdbf44d0c707214edb38
Author: Robert Bragg <robert linux intel com>
Date:   Tue Apr 5 17:01:24 2011 +0100

    pipeline: reclaim ownership if reverting to layer ancestor
    
    In _cogl_pipeline_prune_empty_layer_difference if we are reverting to
    the immediate parent of an empty/redundant layer then it is not enough
    to simply add a reference to the pipeline's ->layer_differences list
    without also updating parent_layer->owner to point back to its new
    owner.
    
    This oversight was leading us to break the invariable that all layers
    referenced in layer_differences have an owner and was also causing us to
    break another invariable whereby after calling
    _cogl_pipeline_layer_pre_change_notify the returned layer must always be
    owned by the given 'required_owner'.
    
    http://bugzilla.clutter-project.org/show_bug.cgi?id=2588

 clutter/cogl/cogl/cogl-pipeline.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/clutter/cogl/cogl/cogl-pipeline.c b/clutter/cogl/cogl/cogl-pipeline.c
index 93c5234..76d02ac 100644
--- a/clutter/cogl/cogl/cogl-pipeline.c
+++ b/clutter/cogl/cogl/cogl-pipeline.c
@@ -2194,7 +2194,8 @@ _cogl_pipeline_prune_empty_layer_difference (CoglPipeline *layers_authority,
   if (layer_parent->index == layer->index && layer_parent->owner == NULL)
     {
       cogl_object_ref (layer_parent);
-      link->data = _cogl_pipeline_layer_get_parent (layer);
+      layer_parent->owner = layers_authority;
+      link->data = layer_parent;
       cogl_object_unref (layer);
       recursively_free_layer_caches (layers_authority);
       return;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]