The plan is to remove the cogl-auto-texture apis since they hide a bit
too much from developers but currently the conformance tests depend on
these apis in numerous places.
For the conformance tests it makes some sense to continue using high
level texture apis similar to the auto-texture apis since we may want
to make broad variations to how textures are allocated as part of the
testing running if that might help exercise more code paths.
This patch copies much of the auto-texture functionality into some
slightly more special purpose utilities in test-utils.c/h. Minor changes
include being constrained to the public Cogl api and they also don't
let you catch CoglErrors and just assume they should abort on error.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit 911df79776ce6f695351c15e9872b4f1479d30bf)
Conflicts:
tests/conform/test-atlas-migration.c
tests/conform/test-backface-culling.c
tests/conform/test-blend-strings.c
tests/conform/test-color-mask.c
tests/conform/test-just-vertex-shader.c
tests/conform/test-npot-texture.c
tests/conform/test-primitive.c
tests/conform/test-snippets.c
tests/conform/test-texture-get-set-data.c
tests/conform/test-texture-mipmap-get-set.c
tests/conform/test-texture-no-allocate.c
tests/conform/test-wrap-modes.c
This renames the global ctx and fb variables to test_ctx and test_fb
respectively in line with the names use on the master branch. This is to
make it easier to cherry pick patches from master.
The coding style has for a long time said to avoid using redundant glib
data types such as gint or gchar etc because we feel that they make the
code look unnecessarily foreign to developers coming from outside of the
Gnome developer community.
Note: When we tried to find the historical rationale for the types we
just found that they were apparently only added for consistent syntax
highlighting which didn't seem that compelling.
Up until now we have been continuing to use some of the platform
specific type such as gint{8,16,32,64} and gsize but this patch switches
us over to using the standard c99 equivalents instead so we can further
ensure that our code looks familiar to the widest range of C developers
who might potentially contribute to Cogl.
So instead of using the gint{8,16,32,64} and guint{8,16,32,64} types this
switches all Cogl code to instead use the int{8,16,32,64}_t and
uint{8,16,32,64}_t c99 types instead.
Instead of gsize we now use size_t
For now we are not going to use the c99 _Bool type and instead we have
introduced a new CoglBool type to use instead of gboolean.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit 5967dad2400d32ca6319cef6cb572e81bf2c15f0)
This adds experimental 2.0 api replacements for the cogl_rectangle[_*]
functions that don't depend on having a current pipeline set on the
context via cogl_{set,push}_source() or having a current framebuffer set
on the context via cogl_push_framebuffer(). The aim for 2.0 is to switch
away from having a statefull context that affects drawing to having
framebuffer drawing apis that are explicitly passed a framebuffer and
pipeline.
To test this change several of the conformance tests were updated to use
this api instead of cogl_rectangle and
cogl_rectangle_with_texture_coords. Since it's quite laborious going
through all of the conformance tests the opportunity was taken to make
other clean ups in the conformance tests to replace other uses of
1.x api with experimental 2.0 api so long as that didn't affect what was
being tested.
This patch reworks our conformance testing framework because it seems
that glib's gtesting framework isn't really well suited to our use case.
For example we weren't able to test windows builds given the way we
were using it and also for each test we'd like to repeat the test
with several different environments so we can test important driver and
feature combinations.
This patch instead switches away to a simplified but custom approach for
running our unit tests. We hope that having a more bespoke setup will
enable us to easily extend it to focus on the details important to us.
Notable changes with this new approach are:
We can now run 'make test' for our mingw windows builds.
We've got rid of all the test-*report* make rules and we're just left
with 'make test'
'make test' now runs each test several times with different driver and
feature combinations checking the result for each run. 'make test' will
then output a concise table of all of the results.
The combinations tested are:
- OpenGL Fixed Function
- OpenGL ARBfp
- OpenGL GLSL
- OpenGL No NPOT texture support
- OpenGLES 2.0
- OpenGLES 2.0 No NPOT texture support
Reviewed-by: Neil Roberts <neil@linux.intel.com>
Most of the conformance tests read a pixel value and assert that it
matches a known value. However they were all doing this with slightly
different methods. This adds a common test_utils_check_pixel function
which they now all use. The function takes an x and y coordinate and a
32-bit value representing the color. It is assumed that writing a
known color is most convenient as an 8 digit hex sequence which this
function allows. There is also a test_utils_check_pixel_rgb function
wrapper which takes the components as separate arguments. This is more
convenient when the expected color is also calculated by the test.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
Uninitialized textures could contain random bits. That makes the test
fail as glColorMask is used to let only one of the RGB pass through.
https://bugzilla.gnome.org/show_bug.cgi?id=660387
Reviewed-by: Neil Roberts <neil@linux.intel.com>
There is a currently a bug where pushing a buffer with a different
color mask will not cause the color mask to be flushed. This adds a
test to demonstrate that.
Reviewed-by: Robert Bragg <robert@linux.intel.com>