Implement EXT_texture_format_BGRA8888 and EXT_read_format_bgra
Trac #13050, Issue=21
Original Author: Vladimir Vukicevic
Signed-off-by: Daniel Koch
git-svn-id: https://angleproject.googlecode.com/svn/trunk@370 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/Texture.cpp b/src/libGLESv2/Texture.cpp
index d671592..b9abb96 100644
--- a/src/libGLESv2/Texture.cpp
+++ b/src/libGLESv2/Texture.cpp
@@ -198,6 +198,12 @@
const unsigned short *source16 = reinterpret_cast<const unsigned short*>(source);
unsigned char *dest = static_cast<unsigned char*>(output) + (y + yoffset) * outputPitch + xoffset * 4;
+ // fast path for EXT_texture_format_BGRA8888
+ if (format == GL_BGRA_EXT && type == GL_UNSIGNED_BYTE) {
+ memcpy(dest, source, width*4);
+ continue;
+ }
+
for (int x = 0; x < width; x++)
{
unsigned char r;