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