cogl_read_pixels: Always use GL_RGBA/GL_UNSIGNED_BYTE under GLES
authorNeil Roberts <neil@linux.intel.com>
Fri, 26 Mar 2010 22:40:53 +0000 (22:40 +0000)
committerNeil Roberts <neil@linux.intel.com>
Wed, 21 Apr 2010 09:56:21 +0000 (10:56 +0100)
commit0cb09cd40d6b031a5514038af73a13d4e7bf2f82
tree79b0051a82e5b0449e3c961abf0c431134594778
parent9750b90f37127c85f7092c16ca64fb0b63501882
cogl_read_pixels: Always use GL_RGBA/GL_UNSIGNED_BYTE under GLES

Under GLES glReadPixels is documented to only support GL_RGBA with
GL_UNSIGNED_BYTE and an implementation specfic format which can be
fetched with glGet, GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES and
GL_IMPLEMENTATION_COLOR_READ_TYPE_OES. This patch makes it always read
using GL_RGBA and GL_UNSIGNED_BYTE and then convert the results if
neccessary.

This has some room for improvement because it doesn't attempt to use
the implementation specific format. Also the conversion is somewhat
wasteful because there are currently no cogl_bitmap_* functions to
convert without allocating a new buffer so it ends up doing an
intermediate copy.

http://bugzilla.openedhand.com/show_bug.cgi?id=2057
clutter/cogl/cogl/cogl.c