[cogl/cogl-1.14] Prune redundant pipeline ancestry after adding a layer difference



commit 22363a41377b68b592b1f777aacfe273fe8ae157
Author: Neil Roberts <neil linux intel com>
Date:   Sat Mar 9 20:00:53 2013 +0000

    Prune redundant pipeline ancestry after adding a layer difference
    
    Adding a layer difference may mean the pipeline overrides all of the
    layers of its parent which might make the parent redundant so we
    should try to prune the hierarchy.
    
    This is particularly important for CoglGst because whenever a new
    frame is ready it tries to make a copy of the pipeline it last used
    and then replace all of the textures in the layers. Without this patch
    the new pipeline would keep the parent pipeline alive which means also
    keeping the old textures alive so all of the frames of the video would
    effectively be leaked.
    
    Reviewed-by: Robert Bragg <robert linux intel com>
    
    (cherry picked from commit 576c7b55aa835448c977f1d79d128dffd40e7cd8)

 cogl/cogl-pipeline.c              |    7 ++++++-
 tests/conform/test-conform-main.c |    2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/cogl/cogl-pipeline.c b/cogl/cogl-pipeline.c
index 253707b..c029f45 100644
--- a/cogl/cogl-pipeline.c
+++ b/cogl/cogl-pipeline.c
@@ -3,7 +3,7 @@
  *
  * An object oriented GL/GLES Abstraction/Utility Layer
  *
- * Copyright (C) 2008,2009,2010 Intel Corporation.
+ * Copyright (C) 2008,2009,2010,2013 Intel Corporation.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -1436,6 +1436,11 @@ _cogl_pipeline_add_layer_difference (CoglPipeline *pipeline,
 
   if (inc_n_layers)
     pipeline->n_layers++;
+
+  /* Adding a layer difference may mean this pipeline now overrides
+   * all of the layers of its parent which might make the parent
+   * redundant so we should try to prune the hierarchy */
+  _cogl_pipeline_prune_redundant_ancestry (pipeline);
 }
 
 void
diff --git a/tests/conform/test-conform-main.c b/tests/conform/test-conform-main.c
index 4110c82..0b55db6 100644
--- a/tests/conform/test-conform-main.c
+++ b/tests/conform/test-conform-main.c
@@ -118,7 +118,7 @@ main (int argc, char **argv)
 
   ADD_TEST (test_primitive_and_journal, 0, 0);
 
-  ADD_TEST (test_copy_replace_texture, 0, TEST_KNOWN_FAILURE);
+  ADD_TEST (test_copy_replace_texture, 0, 0);
 
   UNPORTED_TEST (test_viewport);
 


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