From cb834c95e98e02a249a9cc6ad74f5d24e9e65edf Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Wed, 5 Sep 2012 14:36:55 +0100 Subject: [PATCH] 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 (cherry picked from commit d3063e8dea92a8f668acef6435cc68e0c901dc8d) --- cogl/cogl-pipeline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cogl/cogl-pipeline.c b/cogl/cogl-pipeline.c index 3cc8c50eb..f07126122 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); }