[cogl/cogl-1.10] pipeline: Fix the layer index used when pruning layers



commit 458c7ce99984aed5c7486f6749bc04f82a1c7b1b
Author: Neil Roberts <neil linux intel com>
Date:   Wed Sep 5 14:36:55 2012 +0100

    pipeline: Fix the layer index used when pruning layers
    
    When pruning a pipeline to a set number of layers it records the index
    of the first layer after the given number of layers have been found.
    This is stored in a variable called 'first_index_to_prune' implying
    that this layer should be included in the layers to be pruned. However
    the subsequent if-statement was only pruning layers with an index
    greater than the recorded index so it would presumably only prune the
    following layers. This patch fixes it to use '>=' instead.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=683414
    
    Reviewed-by: Robert Bragg <robert linux intel com>
    
    (cherry picked from commit d3063e8dea92a8f668acef6435cc68e0c901dc8d)

 cogl/cogl-pipeline.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/cogl/cogl-pipeline.c b/cogl/cogl-pipeline.c
index cc1909e..1f49e39 100644
--- a/cogl/cogl-pipeline.c
+++ b/cogl/cogl-pipeline.c
@@ -1546,7 +1546,7 @@ _cogl_pipeline_prune_to_n_layers (CoglPipeline *pipeline, int n)
       CoglPipelineLayer *layer = l->data;
       next = l->next; /* we're modifying the list we're iterating */
 
-      if (layer->index > state.first_index_to_prune)
+      if (layer->index >= state.first_index_to_prune)
         _cogl_pipeline_remove_layer_difference (pipeline, layer, FALSE);
     }
 



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