1
0
Fork 0
Commit graph

5 commits

Author SHA1 Message Date
Neil Roberts
884647071c test-just-vertex-shader: Sample a texture in the fragment pipeline
Previously the layer combine on the test pipeline was set up to
replace the incoming color with the layer constant. This patch changes
it to sample the replacement color from a 1x1 texture instead. This
exposes a bug on the GLES2 backend where the vertex shader will be
generated with a size for cogl_tex_coord_out of 4 but the
corresponding declaration in the fragment shader will have n_layers,
which is 1. This makes the program fail to link and the test fails.

https://bugzilla.gnome.org/show_bug.cgi?id=662184

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-11-02 13:50:28 +00:00
Neil Roberts
e69e41b2c7 tests: Add a utility function for reading a pixel
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>
2011-10-26 18:57:33 +01:00
Robert Bragg
6c0dd4aab1 tests: avoid redundant setting of projection/modelview
This removes some redundant initializing of the modelview matrix since
we can assume the initial state is already the identity matrix. The
explicit initialization was only really necessary when running as a
clutter test because there the default matrix isn't the identity matrix.

Also some calls to cogl_orth to change the projection matrix have been
moved into the test entry point functions instead of calling this in the
paint function. Again the previous style probably came about because
with clutter we always had to re-assert the projection but now we are in
full control of the projection and can assume it doesn't need
re-asserting once set.

Acked-by: Luca Bruno <lucabru@src.gnome.org>
2011-10-01 15:53:48 +01:00
Luca Bruno
5784905462 Port just-vertex-shader to test both the legacy and the new API
Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-10-01 15:02:03 +01:00
Robert Bragg
b5a7657076 Starts porting Cogl conformance tests from Clutter
This makes a start on porting the Cogl conformance tests that currently
still live in the Clutter repository to be standalone Cogl tests that no
longer require a ClutterStage.

The main thing is that this commit brings in is the basic testing
infrastructure we need, so now we can port more and more tests
incrementally.

Since the test suite wants a way to synchronize X requests/replies and
we can't simply call XSynchronize in the test-utils code before we know
if we are really running on X this adds a check for an environment
variable named "COGL_X11_SYNC" in cogl-xlib-renderer.c and if it's set
it forces XSynchronize (dpy, TRUE) to be called.

By default the conformance tests are run off screen. This makes the
tests run much faster and they also don't interfere with other work you
may want to do by constantly stealing focus. CoglOnscreen framebuffers
obviously don't get tested this way so it's important that the tests
also get run on screen every once in a while, especially if changes are
being made to CoglFramebuffer related code.  On screen testing can be
enabled by setting COGL_TEST_ONSCREEN=1 in your environment.
2011-09-08 15:48:07 +01:00