c5da2d
# HG changeset patch
c5da2d
# Parent  acf59ea86dd1d878b43920832093f082dcfc61c0
c5da2d
c5da2d
diff -r acf59ea86dd1 gfx/skia/skia/src/shaders/gradients/Sk4fLinearGradient.cpp
c5da2d
--- a/gfx/skia/skia/src/shaders/gradients/Sk4fLinearGradient.cpp	Mon Mar 09 08:26:10 2020 +0100
c5da2d
+++ b/gfx/skia/skia/src/shaders/gradients/Sk4fLinearGradient.cpp	Fri Mar 27 13:30:28 2020 +0100
c5da2d
@@ -7,7 +7,7 @@
c5da2d
 
c5da2d
 #include "include/core/SkPaint.h"
c5da2d
 #include "src/shaders/gradients/Sk4fLinearGradient.h"
c5da2d
-
c5da2d
+#include "src/core/SkEndian.h"
c5da2d
 #include <cmath>
c5da2d
 #include <utility>
c5da2d
 
c5da2d
@@ -28,6 +28,9 @@
c5da2d
 
c5da2d
     while (n >= 4) {
c5da2d
         DstTraits<premul>::store4x(c0, c1, c2, c3, dst, bias0, bias1);
c5da2d
+#ifdef SK_CPU_BENDIAN
c5da2d
+        SkEndianSwap32s(dst, 4);
c5da2d
+#endif
c5da2d
         dst += 4;
c5da2d
 
c5da2d
         c0 = c0 + dc4;
c5da2d
@@ -37,12 +40,23 @@
c5da2d
         n -= 4;
c5da2d
     }
c5da2d
     if (n & 2) {
c5da2d
-        DstTraits<premul>::store(c0, dst++, bias0);
c5da2d
-        DstTraits<premul>::store(c1, dst++, bias1);
c5da2d
+        DstTraits<premul>::store(c0, dst, bias0);
c5da2d
+#ifdef SK_CPU_BENDIAN
c5da2d
+        *dst = SkEndianSwap32(*dst);
c5da2d
+#endif
c5da2d
+        ++dst;
c5da2d
+        DstTraits<premul>::store(c1, dst, bias1);
c5da2d
+#ifdef SK_CPU_BENDIAN
c5da2d
+        *dst = SkEndianSwap32(*dst);
c5da2d
+#endif
c5da2d
+        ++dst;
c5da2d
         c0 = c0 + dc2;
c5da2d
     }
c5da2d
     if (n & 1) {
c5da2d
         DstTraits<premul>::store(c0, dst, bias0);
c5da2d
+#ifdef SK_CPU_BENDIAN
c5da2d
+        *dst = SkEndianSwap32(*dst);
c5da2d
+#endif
c5da2d
     }
c5da2d
 }
c5da2d