Add support for RG textures

Desktop / GNOME / COGL - Neil Roberts [linux.intel.com] - 20 January 2014 08:28 UTC

This adds COGL_PIXEL_FORMAT_RG_88 and COGL_TEXTURE_COMPONENTS_RG in order to support two-component textures. The RG components for a texture is only supported if COGL_FEATURE_ID_TEXTURE_RG is advertised. This is only available on GL 3, GL 2 with the GL_ARB_texture_rg extension or GLES with the GL_EXT_texture_rg extension. The RG pixel format is always supported for images because Cogl can easily do the conversion if an application uses this format to upload to a texture with a different format.

If an application tries to create an RG texture when the feature isn't supported then it will raise an error when the texture is allocated.

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

568677a Add support for RG textures
cogl/cogl-bitmap-conversion.c | 40 +++++++++++----
cogl/cogl-bitmap-packing.h | 36 ++++++++++++++
cogl/cogl-context.h | 4 ++
cogl/cogl-texture.c | 15 ++++++
cogl/cogl-texture.h | 13 +++++
cogl/cogl-types.h | 5 ++
cogl/driver/gl/gl/cogl-driver-gl.c | 30 +++++++++++
cogl/driver/gl/gles/cogl-driver-gles.c | 31 ++++++++++++
test-fixtures/test-utils.c | 6 +++
test-fixtures/test-utils.h | 15 +++---
tests/conform/Makefile.am | 1 +
tests/conform/test-conform-main.c | 2 +
tests/conform/test-read-texture-formats.c | 22 +++++++++
tests/conform/test-texture-rg.c | 74 ++++++++++++++++++++++++++++
tests/conform/test-write-texture-formats.c | 5 ++
15 files changed, 283 insertions(+), 16 deletions(-)

Upstream: developer.gnome.org


  • Share