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