Commit Graph

4 Commits

Author SHA1 Message Date
Neil Roberts
d12399b823 test-gles2-context: Add a test case for rendering to an FBO
This adds an extra test to test-gles2-context which renders to an FBO
and then checks that the orientation is correct once the texture is
rendered via Cogl. This should test the code path to flip the GLES2
rendering in Cogl.

The rendering is done in three different ways to test the various
state that needs flipping:

• Just renders two triangle strips, one at the top and one at the
  bottom.

• Renders two full screen triangle strips, but each with a different
  viewport to clip it to the top or the bottom.

• Clears the screen with two different colors and a scissor to either
  the top or the bottom.

• Renders both quads twice with two different colors and two different
  front face states.

Additionally the rendering is verified by calling glReadPixels to
check that the returned pixels are flipped correctly.

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

(cherry picked from commit 5b097f9bc4a3eb316c6bf0d9fe8db00ff93bfe73)
2012-08-15 13:44:16 +01:00
Neil Roberts
4c1b7c979d test-gles2-context: Fix error checking for cogl_gles2_context_new
The test was passing NULL as the error argument but then trying to use
the error object if it failed so it would just crash in that case.

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

(cherry picked from commit 61cbbb3000fb4001d51999fd05179c620b7e56bf)
2012-08-14 18:55:42 +01:00
Neil Roberts
06c3a7bc70 Fix a warning on test-gles2-context
test-gles2-context was giving a warning because printf was being used
without including stdio.h. This changes it to use g_print and to first
check for g_test_verbose().

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

(cherry picked from commit 9f4945e3daa693e1aa56fe4c1ce37fcc545f8558)
2012-08-06 14:27:43 +01:00
Robert Bragg
8d0b771cd3 conform: Adds a gles2 context test
This adds a conformance test that creates a GLES2 context via the cogl
api and verifies clearing an offscreen framebuffer via the gles2 api,
and switching back and forth between the Cogl and GLES2 apis.

Reviewed-by: Neil Roberts <neil@linux.intel.com>

(cherry picked from commit 9369c60a596c0cbc7a8bb9a45d7b8ffb6a848311)
2012-08-06 14:27:42 +01:00