mozilla-bmo1504834-part3.patch
author Wolfgang Rosenauer <wr@rosenauer.org>
Fri, 19 Jun 2020 10:01:49 +0200
changeset 1136 d068eb84b4d3
parent 1123 7fa561e5d7c7
permissions -rw-r--r--
sync SLE specifics
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1101
a4709640638e added several arch specific (mainly BE) patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     1
# HG changeset patch
1123
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1108
diff changeset
     2
# Parent  d1d66f7e4d0e7fd45e91e4fcee07555e72046d48
1101
a4709640638e added several arch specific (mainly BE) patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     3
For FF68, AntiAliasing of XULTexts seem to be broken on big endian (s390x). Text and icons of the sandwich-menu to the
a4709640638e added several arch specific (mainly BE) patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     4
right of the address bar, as well as plugin-windows appears transparant, which usually means unreadable (white on white).
a4709640638e added several arch specific (mainly BE) patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     5
1123
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1108
diff changeset
     6
diff --git a/gfx/skia/skia/include/private/SkNx.h b/gfx/skia/skia/include/private/SkNx.h
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1108
diff changeset
     7
--- a/gfx/skia/skia/include/private/SkNx.h
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1108
diff changeset
     8
+++ b/gfx/skia/skia/include/private/SkNx.h
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1108
diff changeset
     9
@@ -233,17 +233,28 @@ struct SkNx<1,T> {
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1108
diff changeset
    10
     AI SkNx operator<<(int bits) const { return fVal << bits; }
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1108
diff changeset
    11
     AI SkNx operator>>(int bits) const { return fVal >> bits; }
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1108
diff changeset
    12
 
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1108
diff changeset
    13
     AI SkNx operator+(const SkNx& y) const { return fVal + y.fVal; }
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1108
diff changeset
    14
     AI SkNx operator-(const SkNx& y) const { return fVal - y.fVal; }
1101
a4709640638e added several arch specific (mainly BE) patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    15
     AI SkNx operator*(const SkNx& y) const { return fVal * y.fVal; }
a4709640638e added several arch specific (mainly BE) patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    16
     AI SkNx operator/(const SkNx& y) const { return fVal / y.fVal; }
a4709640638e added several arch specific (mainly BE) patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    17
 
a4709640638e added several arch specific (mainly BE) patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    18
+    // On Big endian the commented out variant doesn't work,
a4709640638e added several arch specific (mainly BE) patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    19
+    // and honestly, I have no idea why it exists in the first place.
a4709640638e added several arch specific (mainly BE) patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    20
+    // The reason its broken is, I think, that it defaults to the double-variant of ToBits()
a4709640638e added several arch specific (mainly BE) patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    21
+    // which gets a 64-bit integer, and FromBits returns 32-bit,
a4709640638e added several arch specific (mainly BE) patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    22
+    // cutting off the wrong half again.
a4709640638e added several arch specific (mainly BE) patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    23
+    // Overall, I see no reason to have ToBits and FromBits at all (even for floats/doubles).
1108
33b03cfb3747 bugfixes, improvements
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1101
diff changeset
    24
+    // Still we are only "fixing" this for big endian and leave little endian alone (never touch a running system)
33b03cfb3747 bugfixes, improvements
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1101
diff changeset
    25
+#ifdef SK_CPU_BENDIAN
1101
a4709640638e added several arch specific (mainly BE) patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    26
+    AI SkNx operator&(const SkNx& y) const { return fVal & y.fVal; }
1108
33b03cfb3747 bugfixes, improvements
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1101
diff changeset
    27
+#else
33b03cfb3747 bugfixes, improvements
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1101
diff changeset
    28
     AI SkNx operator&(const SkNx& y) const { return FromBits(ToBits(fVal) & ToBits(y.fVal)); }
33b03cfb3747 bugfixes, improvements
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1101
diff changeset
    29
+#endif
1101
a4709640638e added several arch specific (mainly BE) patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    30
     AI SkNx operator|(const SkNx& y) const { return FromBits(ToBits(fVal) | ToBits(y.fVal)); }
a4709640638e added several arch specific (mainly BE) patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    31
     AI SkNx operator^(const SkNx& y) const { return FromBits(ToBits(fVal) ^ ToBits(y.fVal)); }
a4709640638e added several arch specific (mainly BE) patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    32
 
1123
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1108
diff changeset
    33
     AI SkNx operator==(const SkNx& y) const { return FromBits(fVal == y.fVal ? ~0 : 0); }
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1108
diff changeset
    34
     AI SkNx operator!=(const SkNx& y) const { return FromBits(fVal != y.fVal ? ~0 : 0); }
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1108
diff changeset
    35
     AI SkNx operator<=(const SkNx& y) const { return FromBits(fVal <= y.fVal ? ~0 : 0); }
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1108
diff changeset
    36
     AI SkNx operator>=(const SkNx& y) const { return FromBits(fVal >= y.fVal ? ~0 : 0); }
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1108
diff changeset
    37
     AI SkNx operator< (const SkNx& y) const { return FromBits(fVal <  y.fVal ? ~0 : 0); }
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1108
diff changeset
    38
diff --git a/gfx/skia/skia/src/opts/SkBlitMask_opts.h b/gfx/skia/skia/src/opts/SkBlitMask_opts.h
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1108
diff changeset
    39
--- a/gfx/skia/skia/src/opts/SkBlitMask_opts.h
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1108
diff changeset
    40
+++ b/gfx/skia/skia/src/opts/SkBlitMask_opts.h
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1108
diff changeset
    41
@@ -198,17 +198,23 @@ namespace SK_OPTS_NS {
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1108
diff changeset
    42
                                        const SkAlpha* mask, size_t maskRB,
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1108
diff changeset
    43
                                        int w, int h) {
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1108
diff changeset
    44
         auto fn = [](const Sk4px& d, const Sk4px& aa) {
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1108
diff changeset
    45
             //   = (s + d(1-sa))aa + d(1-aa)
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1108
diff changeset
    46
             //   = s*aa + d(1-sa*aa)
1101
a4709640638e added several arch specific (mainly BE) patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    47
             //   ~~~>
a4709640638e added several arch specific (mainly BE) patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    48
             // a = 1*aa + d(1-1*aa) = aa + d(1-aa)
a4709640638e added several arch specific (mainly BE) patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    49
             // c = 0*aa + d(1-1*aa) =      d(1-aa)
a4709640638e added several arch specific (mainly BE) patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    50
+
a4709640638e added several arch specific (mainly BE) patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    51
+            // For big endian we have to swap the alpha-mask from 0,0,0,255 to 255,0,0,0
1108
33b03cfb3747 bugfixes, improvements
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1101
diff changeset
    52
+#ifdef SK_CPU_BENDIAN
1101
a4709640638e added several arch specific (mainly BE) patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    53
+            return Sk4px(Sk16b(aa) & Sk16b(255,0,0,0, 255,0,0,0, 255,0,0,0, 255,0,0,0))
1108
33b03cfb3747 bugfixes, improvements
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1101
diff changeset
    54
+#else
33b03cfb3747 bugfixes, improvements
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1101
diff changeset
    55
             return Sk4px(Sk16b(aa) & Sk16b(0,0,0,255, 0,0,0,255, 0,0,0,255, 0,0,0,255))
33b03cfb3747 bugfixes, improvements
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1101
diff changeset
    56
+#endif
1101
a4709640638e added several arch specific (mainly BE) patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    57
                  + d.approxMulDiv255(aa.inv());
a4709640638e added several arch specific (mainly BE) patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    58
         };
a4709640638e added several arch specific (mainly BE) patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    59
         while (h --> 0) {
1123
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1108
diff changeset
    60
             Sk4px::MapDstAlpha(w, dst, mask, fn);
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1108
diff changeset
    61
             dst  +=  dstRB / sizeof(*dst);
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1108
diff changeset
    62
             mask += maskRB / sizeof(*mask);
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1108
diff changeset
    63
         }
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1108
diff changeset
    64
     }