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 |
|
1190
|
9 |
Index: firefox-115.0/gfx/gl/GLContext.h
|
|
10 |
===================================================================
|
|
11 |
--- firefox-115.0.orig/gfx/gl/GLContext.h
|
|
12 |
+++ firefox-115.0/gfx/gl/GLContext.h
|
|
13 |
@@ -1560,6 +1560,13 @@ class GLContext : public GenericAtomicRe
|
1114
|
14 |
BEFORE_GL_CALL;
|
|
15 |
mSymbols.fReadPixels(x, y, width, height, format, type, pixels);
|
|
16 |
OnSyncCall();
|
1122
|
17 |
+#if MOZ_BIG_ENDIAN()
|
1114
|
18 |
+ uint8_t* itr = (uint8_t*)pixels;
|
|
19 |
+ for (GLsizei i = 0; i < width * height; i++) {
|
|
20 |
+ NativeEndian::swapToLittleEndianInPlace((uint32_t*)itr, 1);
|
|
21 |
+ itr += 4;
|
|
22 |
+ }
|
|
23 |
+#endif
|
|
24 |
AFTER_GL_CALL;
|
|
25 |
mHeavyGLCallsSinceLastFlush = true;
|
|
26 |
}
|