summarylogtreecommitdiffstats
path: root/mozilla-bmo849632.patch
diff options
context:
space:
mode:
authorfrancoism902021-10-23 20:11:17 +0200
committerfrancoism902021-10-23 20:11:17 +0200
commiteb697dedfb8a97728bf76ab4ab5a1dc9b4b037c6 (patch)
treeab3c88ed1c21dbd18158c884e036caff2ccb0283 /mozilla-bmo849632.patch
downloadaur-eb697dedfb8a97728bf76ab4ab5a1dc9b4b037c6.tar.gz
Initial commit
Diffstat (limited to 'mozilla-bmo849632.patch')
-rw-r--r--mozilla-bmo849632.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/mozilla-bmo849632.patch b/mozilla-bmo849632.patch
new file mode 100644
index 000000000000..9de64b91ea06
--- /dev/null
+++ b/mozilla-bmo849632.patch
@@ -0,0 +1,35 @@
+# HG changeset patch
+# Parent 3de59fe1b8708c01e134ce698c4232b8a854f617
+Problem: webGL sites are displayed in the wrong color (usually blue-ish)
+Solution: Problem is with skia once again. Output of webgl seems endian-correct, but skia only
+ knows how to deal with little endian.
+ So we swizzle the output of webgl after reading it from readpixels()
+Note: This does not fix all webGL sites, but is a step in the right direction
+
+diff --git a/gfx/gl/GLContext.h b/gfx/gl/GLContext.h
+--- a/gfx/gl/GLContext.h
++++ b/gfx/gl/GLContext.h
+@@ -1548,16 +1548,23 @@ class GLContext : public GenericAtomicRe
+ AFTER_GL_CALL;
+ }
+
+ void raw_fReadPixels(GLint x, GLint y, GLsizei width, GLsizei height,
+ GLenum format, GLenum type, GLvoid* pixels) {
+ BEFORE_GL_CALL;
+ mSymbols.fReadPixels(x, y, width, height, format, type, pixels);
+ OnSyncCall();
++#if MOZ_BIG_ENDIAN()
++ uint8_t* itr = (uint8_t*)pixels;
++ for (GLsizei i = 0; i < width * height; i++) {
++ NativeEndian::swapToLittleEndianInPlace((uint32_t*)itr, 1);
++ itr += 4;
++ }
++#endif
+ AFTER_GL_CALL;
+ mHeavyGLCallsSinceLastFlush = true;
+ }
+
+ void fReadPixels(GLint x, GLint y, GLsizei width, GLsizei height,
+ GLenum format, GLenum type, GLvoid* pixels);
+
+ public: