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