Merge inbound to mozilla-central. a=merge
authorMargareta Eliza Balazs <ebalazs@mozilla.com>
Mon, 05 Nov 2018 11:48:33 +0200
changeset 444367 d2963b5a28976cadce6d67407fb754a36194b544
parent 444366 db00f49fe9829665116ff5b6117cbc92e795dcb9 (current diff)
parent 444339 5d4e3be63538ea8fb0d61968b39d7139f9ee10f2 (diff)
child 444368 4a54c96fade967ad9337862f31f62fc55f44d819
child 444395 44dc7d4993ec12415622b446294f59e57d425be6
push id109568
push userebalazs@mozilla.com
push dateMon, 05 Nov 2018 09:53:45 +0000
treeherdermozilla-inbound@4a54c96fade9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone65.0a1
first release with
nightly linux32
d2963b5a2897 / 65.0a1 / 20181105100136 / files
nightly linux64
d2963b5a2897 / 65.0a1 / 20181105100136 / files
nightly mac
d2963b5a2897 / 65.0a1 / 20181105100136 / files
nightly win32
d2963b5a2897 / 65.0a1 / 20181105100136 / files
nightly win64
d2963b5a2897 / 65.0a1 / 20181105100136 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge inbound to mozilla-central. a=merge
--- a/gfx/skia/skia/src/core/SkColor.cpp
+++ b/gfx/skia/skia/src/core/SkColor.cpp
@@ -105,23 +105,39 @@ SkColor SkHSVToColor(U8CPU a, const SkSc
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 #include "SkPM4f.h"
 
 template <>
 SkColor4f SkColor4f::FromColor(SkColor bgra) {
     SkColor4f rgba;
-    swizzle_rb(Sk4f_fromL32(bgra)).store(rgba.vec());
+    Sk4f c4f = Sk4f_fromL32(bgra);
+#ifdef SK_CPU_BENDIAN
+    // ARGB -> RGBA
+    c4f = SkNx_shuffle<1, 2, 3, 0>(c4f);
+#else
+    // BGRA -> RGBA
+    c4f = swizzle_rb(c4f);
+#endif
+    c4f.store(rgba.vec());
     return rgba;
 }
 
 template <>
 SkColor SkColor4f::toSkColor() const {
-    return Sk4f_toL32(swizzle_rb(Sk4f::Load(this->vec())));
+    Sk4f c4f = Sk4f::Load(this->vec());
+#ifdef SK_CPU_BENDIAN
+    // RGBA -> ARGB
+    c4f = SkNx_shuffle<3, 0, 1, 2>(c4f);
+#else
+    // RGBA -> BGRA
+    c4f = swizzle_rb(c4f);
+#endif
+    return Sk4f_toL32(c4f);
 }
 
 template <>
 SkPMColor4f SkPMColor4f::FromPMColor(SkPMColor c) {
     SkPMColor4f color;
     swizzle_rb_if_bgra(Sk4f_fromL32(c)).store(&color);
     return color;
 }