Commit Graph

1 Commits

Author SHA1 Message Date
Neil Roberts
f9456574ef Add test to verify replacing a layer doesn't leak the pipeline parent
The current recommendation for pipelines is that once they have been
used for painting then they should be considered immutable. If you
want to modify a pipeline you should instead make a copy and unref the
original pipeline. Internally we try to check whether the modified
copy replaces all of the properties of the parent and prune a
redundant ancestor hierarchy. Pruning the hierarchy is particularly
important if the pipelines contain textures because otherwise the
textures may be leaked when the parent pipeline keeps a reference to
it.

This test verifies that usage pattern by creating a chain of pipeline
copies each with their own replacement texture. Some user data is then
set on the textures with a callback so that we can verify that once
the original pipelines are destroyed then the textures are also
destroyed.

The test is currently failing because Cogl doesn't correctly prune
ancestory for layer state authority.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit 3fbec92acb90008492eb125025f92b42d6e07930)
2013-03-19 17:53:43 +00:00