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