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)
This commit is contained in:
Neil Roberts 2012-09-05 14:36:55 +01:00
parent a18c97798f
commit cb834c95e9

View File

@ -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);
}