21e304b339
This extension allows an application to upload data in BGRA format. We can use this to avoid a conversion in Cogl whenever it is given BGRA data. This is quite useful when uploading data generated by Cairo because at least on little-endian architectures that ends up as BGRA. The patch just makes the pixel_format_to_gl implementation return GL_BGRA_EXT for the data format and internal format whenever COGL_PIXEL_FORMAT_BGRA_8888{,_PRE} is used. A small caveat with this patch is that once a texture is created as GL_BGRA, when later using glTexSubImage2D to update the texture it must always be given data as GL_BGRA. Currently this just works out because we store the internal format of a texture as a CoglPixelFormat and we already swizzle the data if it does not match exactly on GLES. However if we later switch to using a different enum for internal formats then we might lose the ability to store the component ordering so we'll have to think of another way to do this. |
||
---|---|---|
.. | ||
gl | ||
gles | ||
Makefile.am |