mutter/tests/conform
Neil Roberts 19ccb72b80 cogl-gles2-context: Wrap glCopyTex{Sub,}Image2D to flip the result
When the CoglGLES2Context is bound to read from a CoglOffscreen then
the result will be upside down from what GL expects if
glCopyTexImage2D is used directly. To fix that, this patch now wraps
glCopyTexImage2D and glCopyTexSubImage2D so that the copy is doing by
binding an FBO to the target texture and then rendering a quad
sampling from the texture in the offscreen framebuffer.

The rendering is done using the Cogl context rather than the GLES2
context because otherwise it would have to do a fair bit of work to
try and stash the old state on the context before setting up the state
to do the blit. The down side of this is that the contexts need to be
synchronized so that the rendering will be up-to-date. As far as I
understand from the GL spec, this requires a glFinish and then the
texture needs to be rebound in the new context because updates to
shared objects are guaranteed to be reflected until the object is
rebound.

GLES2 supports using glCopyTexImage2D for cube map textures. As Cogl
doesn't currently have support for cube maps, it is quite hard to get
that to work with this patch. For now attempts to copy to a cube map
texture will just be sliently ignored.

This patch also includes a test case which renders an image to the
framebuffer and then copies it to a texture. The texture is then
rendered back to the framebuffer and the contents are checked for the
correct orientation using glReadPixels.

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

(cherry picked from commit 30b6da8134bad95267265e26685c7475f6c351c9)
2012-08-15 13:46:20 +01:00
..
config.env.in tests: Improve thoroughness and reporting of make test 2012-02-24 14:42:31 +00:00
Makefile.am Mass rename CLUTTER_COMPILATION to COGL_COMPILATION 2012-08-06 14:27:45 +01:00
run-tests.sh tests: Improve thoroughness and reporting of make test 2012-02-24 14:42:31 +00:00
test-atlas-migration.c Convert the test-atlas-migration test to a standalone Cogl test 2012-08-06 14:27:42 +01:00
test-backface-culling.c Switch use of primitive glib types to c99 equivalents 2012-08-06 14:27:39 +01:00
test-bitmask.c Switch use of primitive glib types to c99 equivalents 2012-08-06 14:27:39 +01:00
test-blend-strings.c Switch use of primitive glib types to c99 equivalents 2012-08-06 14:27:39 +01:00
test-color-mask.c Switch use of primitive glib types to c99 equivalents 2012-08-06 14:27:39 +01:00
test-conform-main.c cogl-gles2-context: Wrap glCopyTex{Sub,}Image2D to flip the result 2012-08-15 13:46:20 +01:00
test-custom-attributes.c Switch use of primitive glib types to c99 equivalents 2012-08-06 14:27:39 +01:00
test-depth-test.c Switch use of primitive glib types to c99 equivalents 2012-08-06 14:27:39 +01:00
test-euler-quaternion.c Add a basic conformance test for eulers and quaternions 2012-08-06 14:27:43 +01:00
test-fixed.c Adds cogl_framebuffer_draw_[*_]rectangle functions 2012-03-20 12:33:40 +00:00
test-fixtures.c Adds cogl_framebuffer_draw_[*_]rectangle functions 2012-03-20 12:33:40 +00:00
test-gles2-context.c cogl-gles2-context: Wrap glCopyTex{Sub,}Image2D to flip the result 2012-08-15 13:46:20 +01:00
test-just-vertex-shader.c Switch use of primitive glib types to c99 equivalents 2012-08-06 14:27:39 +01:00
test-launcher.sh.in tests: Improve thoroughness and reporting of make test 2012-02-24 14:42:31 +00:00
test-layer-remove.c Add a conformance test for removing a pipeline layer 2012-08-06 14:27:45 +01:00
test-materials.c Switch use of primitive glib types to c99 equivalents 2012-08-06 14:27:39 +01:00
test-multitexture.c Switch use of primitive glib types to c99 equivalents 2012-08-06 14:27:39 +01:00
test-no-gl-header.c Mass rename CLUTTER_COMPILATION to COGL_COMPILATION 2012-08-06 14:27:45 +01:00
test-npot-texture.c Switch use of primitive glib types to c99 equivalents 2012-08-06 14:27:39 +01:00
test-object.c Adds cogl_framebuffer_draw_[*_]rectangle functions 2012-03-20 12:33:40 +00:00
test-offscreen.c Switch use of primitive glib types to c99 equivalents 2012-08-06 14:27:39 +01:00
test-path.c Replace cogl_path_{stroke,fill} with framebuffer API 2012-08-06 14:27:39 +01:00
test-pipeline-uniforms.c Switch use of primitive glib types to c99 equivalents 2012-08-06 14:27:39 +01:00
test-pipeline-user-matrix.c Switch use of primitive glib types to c99 equivalents 2012-08-06 14:27:39 +01:00
test-pixel-buffer.c Switch use of primitive glib types to c99 equivalents 2012-08-06 14:27:39 +01:00
test-point-size.c Switch use of primitive glib types to c99 equivalents 2012-08-06 14:27:39 +01:00
test-point-sprite.c Split test-point-sprite into two, one without checking orientation 2012-08-06 18:51:31 +01:00
test-premult.c Switch use of primitive glib types to c99 equivalents 2012-08-06 14:27:39 +01:00
test-primitive.c Switch use of primitive glib types to c99 equivalents 2012-08-06 14:27:39 +01:00
test-read-texture-formats.c Switch use of primitive glib types to c99 equivalents 2012-08-06 14:27:39 +01:00
test-readpixels.c Switch use of primitive glib types to c99 equivalents 2012-08-06 14:27:39 +01:00
test-snippets.c Switch use of primitive glib types to c99 equivalents 2012-08-06 14:27:39 +01:00
test-sparse-pipeline.c Adds cogl_framebuffer_draw_[*_]rectangle functions 2012-03-20 12:33:40 +00:00
test-sub-texture.c Switch use of primitive glib types to c99 equivalents 2012-08-06 14:27:39 +01:00
test-texture-3d.c Switch use of primitive glib types to c99 equivalents 2012-08-06 14:27:39 +01:00
test-texture-get-set-data.c Switch use of primitive glib types to c99 equivalents 2012-08-06 14:27:39 +01:00
test-texture-mipmaps.c Switch use of primitive glib types to c99 equivalents 2012-08-06 14:27:39 +01:00
test-texture-pixmap-x11.c Switch use of primitive glib types to c99 equivalents 2012-08-06 14:27:39 +01:00
test-texture-rectangle.c Switch use of primitive glib types to c99 equivalents 2012-08-06 14:27:39 +01:00
test-utils.c Adds gles2-context renderer constraint 2012-08-06 14:27:43 +01:00
test-utils.h Adds gles2-context renderer constraint 2012-08-06 14:27:43 +01:00
test-version.c Add a cogl-version header 2012-08-06 14:27:40 +01:00
test-vertex-buffer-contiguous.c Switch use of primitive glib types to c99 equivalents 2012-08-06 14:27:39 +01:00
test-vertex-buffer-interleved.c Switch use of primitive glib types to c99 equivalents 2012-08-06 14:27:39 +01:00
test-vertex-buffer-mutability.c Switch use of primitive glib types to c99 equivalents 2012-08-06 14:27:39 +01:00
test-viewport.c Switch use of primitive glib types to c99 equivalents 2012-08-06 14:27:39 +01:00
test-wrap-modes.c Switch use of primitive glib types to c99 equivalents 2012-08-06 14:27:39 +01:00
test-write-texture-formats.c Switch use of primitive glib types to c99 equivalents 2012-08-06 14:27:39 +01:00