Dash:
[t2-trunk.git] / package / www / firefox / Skia-menu-fonts.patch
blobbc2b74bb3b39001b769ea4c43e16572f7d0947e9
1 https://bugzilla.mozilla.org/show_bug.cgi?id=1504834#c9
2 https://bugs.chromium.org/p/skia/issues/detail?id=9781
4 --- a/gfx/skia/skia/include/private/SkNx.h
5 +++ b/gfx/skia/skia/include/private/SkNx.h
6 @@ -238,7 +238,18 @@
7 AI SkNx operator*(const SkNx& y) const { return fVal * y.fVal; }
8 AI SkNx operator/(const SkNx& y) const { return fVal / y.fVal; }
10 + // On Big endian the commented out variant doesn't work,
11 + // and honestly, I have no idea why it exists in the first place.
12 + // The reason its broken is, I think, that it defaults to the double-variant of ToBits()
13 + // which gets a 64-bit integer, and FromBits returns 32-bit,
14 + // cutting off the wrong half again.
15 + // Overall, I see no reason to have ToBits and FromBits at all (even for floats/doubles).
16 + // Still we are only "fixing" this for big endian and leave little endian alone (never touch a running system)
17 +#ifdef SK_CPU_BENDIAN
18 + AI SkNx operator&(const SkNx& y) const { return fVal & y.fVal; }
19 +#else
20 AI SkNx operator&(const SkNx& y) const { return FromBits(ToBits(fVal) & ToBits(y.fVal)); }
21 +#endif
22 AI SkNx operator|(const SkNx& y) const { return FromBits(ToBits(fVal) | ToBits(y.fVal)); }
23 AI SkNx operator^(const SkNx& y) const { return FromBits(ToBits(fVal) ^ ToBits(y.fVal)); }
25 --- a/gfx/skia/skia/src/opts/SkBlitMask_opts.h
26 +++ b/gfx/skia/skia/src/opts/SkBlitMask_opts.h
27 @@ -203,7 +203,13 @@
28 // ~~~>
29 // a = 1*aa + d(1-1*aa) = aa + d(1-aa)
30 // c = 0*aa + d(1-1*aa) = d(1-aa)
32 + // For big endian we have to swap the alpha-mask from 0,0,0,255 to 255,0,0,0
33 +#ifdef SK_CPU_BENDIAN
34 + return Sk4px(Sk16b(aa) & Sk16b(255,0,0,0, 255,0,0,0, 255,0,0,0, 255,0,0,0))
35 +#else
36 return Sk4px(Sk16b(aa) & Sk16b(0,0,0,255, 0,0,0,255, 0,0,0,255, 0,0,0,255))
37 +#endif
38 + d.approxMulDiv255(aa.inv());
40 while (h --> 0) {