mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Bug 724476 - Add ANGLE patch file for impl. readpixel format BGRA - r=bjacob
This commit is contained in:
parent
e36d517115
commit
fb651909f4
@ -11,6 +11,7 @@ In this order:
|
||||
angle-use-xmalloc.patch - see bug 680840. Can drop this patch whenever the new preprocessor lands.
|
||||
angle-castrate-bug-241.patch - see bug 699033 / angle bug 241
|
||||
angle-enforce-readpixels-spec.patch - see bug 724476.
|
||||
angle-impl-read-bgra.patch - see bug 724476.
|
||||
|
||||
In addition to these patches, the Makefile.in files are ours, they're not present in upsteam ANGLE.
|
||||
|
||||
|
71
gfx/angle/angle-impl-read-bgra.patch
Normal file
71
gfx/angle/angle-impl-read-bgra.patch
Normal file
@ -0,0 +1,71 @@
|
||||
From: Jeff Gilbert <jgilbert@mozilla.com>
|
||||
Bug 724476 - ANGLE Bug 294 - Use BGRA/UBYTE as exposed fast format/type for readPixels
|
||||
|
||||
diff --git a/gfx/angle/src/libGLESv2/Context.cpp b/gfx/angle/src/libGLESv2/Context.cpp
|
||||
--- a/gfx/angle/src/libGLESv2/Context.cpp
|
||||
+++ b/gfx/angle/src/libGLESv2/Context.cpp
|
||||
@@ -2520,16 +2520,17 @@ void Context::readPixels(GLint x, GLint
|
||||
{
|
||||
if (desc.Format == D3DFMT_A8R8G8B8 &&
|
||||
format == GL_BGRA_EXT &&
|
||||
type == GL_UNSIGNED_BYTE)
|
||||
{
|
||||
// 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);
|
||||
continue;
|
||||
}
|
||||
|
||||
for (int i = 0; i < rect.right - rect.left; i++)
|
||||
{
|
||||
@@ -2666,20 +2667,20 @@ void Context::readPixels(GLint x, GLint
|
||||
((unsigned short)( a + 0.5f) << 15) |
|
||||
((unsigned short)(31 * r + 0.5f) << 10) |
|
||||
((unsigned short)(31 * g + 0.5f) << 5) |
|
||||
((unsigned short)(31 * b + 0.5f) << 0);
|
||||
break;
|
||||
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) |
|
||||
((unsigned short)(31 * r + 0.5f) << 11);
|
||||
break;
|
||||
default: UNREACHABLE();
|
||||
}
|
||||
break;
|
||||
diff --git a/gfx/angle/src/libGLESv2/Context.h b/gfx/angle/src/libGLESv2/Context.h
|
||||
--- a/gfx/angle/src/libGLESv2/Context.h
|
||||
+++ b/gfx/angle/src/libGLESv2/Context.h
|
||||
@@ -69,18 +69,18 @@ enum
|
||||
MAX_VARYING_VECTORS_SM3 = 10,
|
||||
MAX_TEXTURE_IMAGE_UNITS = 16,
|
||||
MAX_VERTEX_TEXTURE_IMAGE_UNITS_VTF = 4, // For devices supporting vertex texture fetch
|
||||
MAX_COMBINED_TEXTURE_IMAGE_UNITS_VTF = MAX_TEXTURE_IMAGE_UNITS + MAX_VERTEX_TEXTURE_IMAGE_UNITS_VTF,
|
||||
MAX_FRAGMENT_UNIFORM_VECTORS_SM2 = 32 - 3, // Reserve space for dx_Coord, dx_Depth, and dx_DepthRange. dx_PointOrLines and dx_FrontCCW use separate bool registers.
|
||||
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
|
||||
{
|
||||
QUERY_ANY_SAMPLES_PASSED,
|
||||
QUERY_ANY_SAMPLES_PASSED_CONSERVATIVE,
|
||||
|
||||
QUERY_TYPE_COUNT
|
Loading…
Reference in New Issue
Block a user