Blame SOURCES/mozilla-bmo849632.patch
|
|
d445b2 |
Problem: webGL sites are displayed in the wrong color (usually blue-ish)
|
|
|
d445b2 |
Solution: Problem is with skia once again. Output of webgl seems endian-correct, but skia only
|
|
|
d445b2 |
knows how to deal with little endian.
|
|
|
d445b2 |
So we swizzle the output of webgl after reading it from readpixels()
|
|
|
d445b2 |
Note: This does not fix all webGL sites, but is a step in the right direction
|
|
|
d445b2 |
diff -r 6b017d3e9733 gfx/gl/GLContext.h
|
|
|
d445b2 |
--- a/gfx/gl/GLContext.h Mon Sep 09 10:04:05 2019 +0200
|
|
|
d445b2 |
+++ b/gfx/gl/GLContext.h Wed Nov 13 17:13:04 2019 +0100
|
|
|
d445b2 |
@@ -1551,6 +1551,13 @@
|
|
|
d445b2 |
BEFORE_GL_CALL;
|
|
|
d445b2 |
mSymbols.fReadPixels(x, y, width, height, format, type, pixels);
|
|
|
d445b2 |
OnSyncCall();
|
|
|
d445b2 |
+#if MOZ_BIG_ENDIAN
|
|
|
d445b2 |
+ uint8_t* itr = (uint8_t*)pixels;
|
|
|
d445b2 |
+ for (GLsizei i = 0; i < width * height; i++) {
|
|
|
d445b2 |
+ NativeEndian::swapToLittleEndianInPlace((uint32_t*)itr, 1);
|
|
|
d445b2 |
+ itr += 4;
|
|
|
d445b2 |
+ }
|
|
|
d445b2 |
+#endif
|
|
|
d445b2 |
AFTER_GL_CALL;
|
|
|
d445b2 |
mHeavyGLCallsSinceLastFlush = true;
|
|
|
d445b2 |
}
|
|
|
d445b2 |
|