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