summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2012-05-24 12:54:44 +0100
committerRobert Bragg <robert@linux.intel.com>2012-08-06 14:27:45 +0100
commita3989d035ef1d5e8aaccb5ed2c4ff26ca41356d0 (patch)
tree0496dbe79beaeac32a0c7435823257b53689a069 /tests
parent2e50693821417e7bd2bc4c9a8dc0918d2c8844a1 (diff)
downloadcogl-a3989d035ef1d5e8aaccb5ed2c4ff26ca41356d0.tar.gz
Fix removing layers when the pipeline is not the owner
If cogl_pipeline_remove_layer is called on a copied pipeline to remove a parent layer then it will still end up calling _cogl_pipeline_remove_layer_difference on the layer. This function was directly trying to remove the layer from the pipeline's list of layer differences. However in the child pipeline the layer isn't in the list because it is unchanged from its parent. The function had an assertion to verify that this situation wasn't hit so in a debug build it would just bail out. This patch removes the assertion and changes it to only remove the layer if it is owned by the pipeline. Otherwise it just sets the COGL_PIPELINE_STATE_LAYERS difference as normal and decrements the number of layers. This will cause it to successfully remove the layer because either it is the last layer in which case it will be ignored after n_layers is decreased or if it is in the middle of the list then the subsequent layers will all be shifted down so there will be a replacement layer difference. Reviewed-by: Robert Bragg <robert@linux.intel.com> (cherry picked from commit 88e73dd93fa09a158064a946ab229591a5888b97)
Diffstat (limited to 'tests')
-rw-r--r--tests/conform/test-conform-main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/conform/test-conform-main.c b/tests/conform/test-conform-main.c
index 02f428f8..aa2f746c 100644
--- a/tests/conform/test-conform-main.c
+++ b/tests/conform/test-conform-main.c
@@ -59,7 +59,7 @@ main (int argc, char **argv)
ADD_TEST (test_depth_test, 0);
ADD_TEST (test_color_mask, 0);
ADD_TEST (test_backface_culling, TEST_REQUIREMENT_NPOT);
- ADD_TEST (test_layer_remove, TEST_KNOWN_FAILURE);
+ ADD_TEST (test_layer_remove, 0);
ADD_TEST (test_sparse_pipeline, 0);