|
|
7d7726 |
# HG changeset patch
|
|
|
7d7726 |
# Parent 3de59fe1b8708c01e134ce698c4232b8a854f617
|
|
|
f7e2cb |
Problem: webGL sites are displayed in the wrong color (usually blue-ish)
|
|
|
f7e2cb |
Solution: Problem is with skia once again. Output of webgl seems endian-correct, but skia only
|
|
|
f7e2cb |
knows how to deal with little endian.
|
|
|
f7e2cb |
So we swizzle the output of webgl after reading it from readpixels()
|
|
|
f7e2cb |
Note: This does not fix all webGL sites, but is a step in the right direction
|
|
|
7d7726 |
|
|
|
7d7726 |
diff --git a/gfx/gl/GLContext.h b/gfx/gl/GLContext.h
|
|
|
7d7726 |
--- a/gfx/gl/GLContext.h
|
|
|
7d7726 |
+++ b/gfx/gl/GLContext.h
|
|
|
7d7726 |
@@ -1548,16 +1548,23 @@ class GLContext : public GenericAtomicRe
|
|
|
7d7726 |
AFTER_GL_CALL;
|
|
|
7d7726 |
}
|
|
|
7d7726 |
|
|
|
7d7726 |
void raw_fReadPixels(GLint x, GLint y, GLsizei width, GLsizei height,
|
|
|
7d7726 |
GLenum format, GLenum type, GLvoid* pixels) {
|
|
|
f7e2cb |
BEFORE_GL_CALL;
|
|
|
f7e2cb |
mSymbols.fReadPixels(x, y, width, height, format, type, pixels);
|
|
|
f7e2cb |
OnSyncCall();
|
|
|
7d7726 |
+#if MOZ_BIG_ENDIAN()
|
|
|
f7e2cb |
+ uint8_t* itr = (uint8_t*)pixels;
|
|
|
f7e2cb |
+ for (GLsizei i = 0; i < width * height; i++) {
|
|
|
f7e2cb |
+ NativeEndian::swapToLittleEndianInPlace((uint32_t*)itr, 1);
|
|
|
f7e2cb |
+ itr += 4;
|
|
|
f7e2cb |
+ }
|
|
|
f7e2cb |
+#endif
|
|
|
f7e2cb |
AFTER_GL_CALL;
|
|
|
f7e2cb |
mHeavyGLCallsSinceLastFlush = true;
|
|
|
f7e2cb |
}
|
|
|
7d7726 |
|
|
|
7d7726 |
void fReadPixels(GLint x, GLint y, GLsizei width, GLsizei height,
|
|
|
7d7726 |
GLenum format, GLenum type, GLvoid* pixels);
|
|
|
7d7726 |
|
|
|
7d7726 |
public:
|