Merge mozilla-central to autoland. a=merge CLOSED TREE
authorMargareta Eliza Balazs <ebalazs@mozilla.com>
Mon, 05 Nov 2018 11:52:05 +0200
changeset 444395 44dc7d4993ec12415622b446294f59e57d425be6
parent 444394 6251012862a2f555766d3166f4630d34dce8773b (current diff)
parent 444367 d2963b5a28976cadce6d67407fb754a36194b544 (diff)
child 444396 538a16d495142178a73e0bdc30f100b43d2fd62b
push id109582
push usercsabou@mozilla.com
push dateMon, 05 Nov 2018 16:21:20 +0000
treeherdermozilla-inbound@4115e3cf7ad0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge mozilla-central to autoland. a=merge CLOSED TREE
--- 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;
 }