1123
|
1 |
# HG changeset patch
|
|
2 |
# Parent 3de59fe1b8708c01e134ce698c4232b8a854f617
|
1114
|
3 |
Problem: webGL sites are displayed in the wrong color (usually blue-ish)
|
|
4 |
Solution: Problem is with skia once again. Output of webgl seems endian-correct, but skia only
|
|
5 |
knows how to deal with little endian.
|
|
6 |
So we swizzle the output of webgl after reading it from readpixels()
|
|
7 |
Note: This does not fix all webGL sites, but is a step in the right direction
|
1123
|
8 |
|
|
9 |
diff --git a/gfx/gl/GLContext.h b/gfx/gl/GLContext.h
|
|
10 |
--- a/gfx/gl/GLContext.h
|
|
11 |
+++ b/gfx/gl/GLContext.h
|
|
12 |
@@ -1548,16 +1548,23 @@ class GLContext : public GenericAtomicRe
|
|
13 |
AFTER_GL_CALL;
|
|
14 |
}
|
|
15 |
|
|
16 |
void raw_fReadPixels(GLint x, GLint y, GLsizei width, GLsizei height,
|
|
17 |
GLenum format, GLenum type, GLvoid* pixels) {
|
1114
|
18 |
BEFORE_GL_CALL;
|
|
19 |
mSymbols.fReadPixels(x, y, width, height, format, type, pixels);
|
|
20 |
OnSyncCall();
|
1122
|
21 |
+#if MOZ_BIG_ENDIAN()
|
1114
|
22 |
+ uint8_t* itr = (uint8_t*)pixels;
|
|
23 |
+ for (GLsizei i = 0; i < width * height; i++) {
|
|
24 |
+ NativeEndian::swapToLittleEndianInPlace((uint32_t*)itr, 1);
|
|
25 |
+ itr += 4;
|
|
26 |
+ }
|
|
27 |
+#endif
|
|
28 |
AFTER_GL_CALL;
|
|
29 |
mHeavyGLCallsSinceLastFlush = true;
|
|
30 |
}
|
1123
|
31 |
|
|
32 |
void fReadPixels(GLint x, GLint y, GLsizei width, GLsizei height,
|
|
33 |
GLenum format, GLenum type, GLvoid* pixels);
|
|
34 |
|
|
35 |
public:
|