Commit Graph

3 Commits

Author SHA1 Message Date
Robert Bragg
785e6375eb Adds a context arg to cogl_pipeline_new()
As we move towards Cogl 2.0 we are aiming to remove the need for a
default global CoglContext and so everything should be explicitly
related to a context somehow. CoglPipelines are top level objects and
so this patch adds a context argument to cogl_pipeline_new().

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-21 12:38:24 +00:00
Neil Roberts
d7164f9579 tests: Move the create_color_texture function to test-utils
This adds a shared utility function to create a 1x1 texture with a
given color.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2012-02-13 17:29:28 +00:00
Neil Roberts
bf7f1e358d Add a test for pipelines with sparse layer indices
There are currently quite a few places in Cogl where we muddle the
layer index and the texture unit number. The theory is that these two
numbers shouldn't be related and it should be possible to pick large
layer numbers with gaps.

This patch adds a test case to check that we can reference a large
layer number from a texture combine string by creating a pipeline with
only three layers but that have very large layer indices. This doesn't
currently work because Cogl interprets the numbers in the combine
strings to be the unit indices and not the layer indices. The
documentation however calls these numbers layer numbers so presumably
it is not meant to work that way.

There are probably many other bugs related to this that the test case
doesn't pick up so it would be good to add some more tests here, for
example to test that you can bind an attribute to the texture
coordinates for a large layer index.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2012-02-13 17:15:35 +00:00