Bug 724476 - ANGLE Bug 294 - Use BGRA/UBYTE as exposed fast format/type for readPixels - r=bjacob

This commit is contained in:
Jeff Gilbert 2012-02-24 14:37:06 -08:00
parent 83f23d825d
commit e36d517115
2 changed files with 5 additions and 4 deletions

View File

@ -2525,6 +2525,7 @@ void Context::readPixels(GLint x, GLint y, GLsizei width, GLsizei height,
// Fast path for EXT_read_format_bgra, given
// an RGBA source buffer. Note that buffers with no
// alpha go through the slow path below.
// Note that this is also the combo exposed by IMPLEMENTATION_COLOR_READ_TYPE/FORMAT
memcpy(dest + j * outputPitch,
source + j * inputPitch,
(rect.right - rect.left) * 4);
@ -2671,10 +2672,10 @@ void Context::readPixels(GLint x, GLint y, GLsizei width, GLsizei height,
default: UNREACHABLE();
}
break;
case GL_RGB: // IMPLEMENTATION_COLOR_READ_FORMAT
case GL_RGB:
switch (type)
{
case GL_UNSIGNED_SHORT_5_6_5: // IMPLEMENTATION_COLOR_READ_TYPE
case GL_UNSIGNED_SHORT_5_6_5:
dest16[i + j * outputPitch / sizeof(unsigned short)] =
((unsigned short)(31 * b + 0.5f) << 0) |
((unsigned short)(63 * g + 0.5f) << 5) |

View File

@ -74,8 +74,8 @@ enum
MAX_FRAGMENT_UNIFORM_VECTORS_SM3 = 224 - 3,
MAX_DRAW_BUFFERS = 1,
IMPLEMENTATION_COLOR_READ_FORMAT = GL_RGB,
IMPLEMENTATION_COLOR_READ_TYPE = GL_UNSIGNED_SHORT_5_6_5
IMPLEMENTATION_COLOR_READ_FORMAT = GL_BGRA_EXT,
IMPLEMENTATION_COLOR_READ_TYPE = GL_UNSIGNED_BYTE
};
enum QueryType