dd1d2c
# HG changeset patch
dd1d2c
# Parent  aecb4600e5da17443b224c79eee178c1d8e155e3
dd1d2c
For FF68, AntiAliasing of XULTexts seem to be broken on big endian (s390x). Text and icons of the sandwich-menu to the
dd1d2c
right of the address bar, as well as plugin-windows appears transparant, which usually means unreadable (white on white).
dd1d2c
dd1d2c
diff -r aecb4600e5da gfx/skia/skia/include/private/SkNx.h
dd1d2c
--- a/gfx/skia/skia/include/private/SkNx.h	Tue Aug 20 09:46:55 2019 +0200
dd1d2c
+++ b/gfx/skia/skia/include/private/SkNx.h	Mon Sep 09 10:04:06 2019 +0200
dd1d2c
@@ -238,7 +238,18 @@
dd1d2c
     AI SkNx operator*(const SkNx& y) const { return fVal * y.fVal; }
dd1d2c
     AI SkNx operator/(const SkNx& y) const { return fVal / y.fVal; }
dd1d2c
 
dd1d2c
+    // On Big endian the commented out variant doesn't work,
dd1d2c
+    // and honestly, I have no idea why it exists in the first place.
dd1d2c
+    // The reason its broken is, I think, that it defaults to the double-variant of ToBits()
dd1d2c
+    // which gets a 64-bit integer, and FromBits returns 32-bit,
dd1d2c
+    // cutting off the wrong half again.
dd1d2c
+    // Overall, I see no reason to have ToBits and FromBits at all (even for floats/doubles).
dd1d2c
+    // Still we are only "fixing" this for big endian and leave little endian alone (never touch a running system)
dd1d2c
+#ifdef SK_CPU_BENDIAN
dd1d2c
+    AI SkNx operator&(const SkNx& y) const { return fVal & y.fVal; }
dd1d2c
+#else
dd1d2c
     AI SkNx operator&(const SkNx& y) const { return FromBits(ToBits(fVal) & ToBits(y.fVal)); }
dd1d2c
+#endif
dd1d2c
     AI SkNx operator|(const SkNx& y) const { return FromBits(ToBits(fVal) | ToBits(y.fVal)); }
dd1d2c
     AI SkNx operator^(const SkNx& y) const { return FromBits(ToBits(fVal) ^ ToBits(y.fVal)); }
dd1d2c
 
dd1d2c
diff -r aecb4600e5da gfx/skia/skia/src/opts/SkBlitMask_opts.h
dd1d2c
--- a/gfx/skia/skia/src/opts/SkBlitMask_opts.h	Tue Aug 20 09:46:55 2019 +0200
dd1d2c
+++ b/gfx/skia/skia/src/opts/SkBlitMask_opts.h	Mon Sep 09 10:04:06 2019 +0200
dd1d2c
@@ -203,7 +203,13 @@
dd1d2c
             //   ~~~>
dd1d2c
             // a = 1*aa + d(1-1*aa) = aa + d(1-aa)
dd1d2c
             // c = 0*aa + d(1-1*aa) =      d(1-aa)
dd1d2c
+
dd1d2c
+            // For big endian we have to swap the alpha-mask from 0,0,0,255 to 255,0,0,0
dd1d2c
+#ifdef SK_CPU_BENDIAN
dd1d2c
+            return Sk4px(Sk16b(aa) & Sk16b(255,0,0,0, 255,0,0,0, 255,0,0,0, 255,0,0,0))
dd1d2c
+#else
dd1d2c
             return Sk4px(Sk16b(aa) & Sk16b(0,0,0,255, 0,0,0,255, 0,0,0,255, 0,0,0,255))
dd1d2c
+#endif
dd1d2c
                  + d.approxMulDiv255(aa.inv());
dd1d2c
         };
dd1d2c
         while (h --> 0) {