Index: src/core/SkColorMatrixFilterRowMajor255.cpp |
diff --git a/src/core/SkColorMatrixFilterRowMajor255.cpp b/src/core/SkColorMatrixFilterRowMajor255.cpp |
index e2545c2af6f7f340a0d4c240bf70495ba2f5fceb..ef234bfdd6a0b01b8eda92b7f83b6d342093d498 100644 |
--- a/src/core/SkColorMatrixFilterRowMajor255.cpp |
+++ b/src/core/SkColorMatrixFilterRowMajor255.cpp |
@@ -12,7 +12,7 @@ |
#include "SkWriteBuffer.h" |
#include "SkUnPreMultiply.h" |
#include "SkString.h" |
-#include "SkPM4f.h" |
+#include "SkPM4fPriv.h" |
#define SK_PMORDER_INDEX_A (SK_A32_SHIFT / 8) |
#define SK_PMORDER_INDEX_R (SK_R32_SHIFT / 8) |
@@ -108,10 +108,10 @@ void filter_span(const float array[], const T src[], int count, T dst[]) { |
srcf = unpremul(srcf); |
} |
- Sk4f r4 = srcf[SK_R32_SHIFT/8]; |
- Sk4f g4 = srcf[SK_G32_SHIFT/8]; |
- Sk4f b4 = srcf[SK_B32_SHIFT/8]; |
- Sk4f a4 = srcf[SK_A32_SHIFT/8]; |
+ Sk4f r4 = srcf[SkPM4f::R]; |
+ Sk4f g4 = srcf[SkPM4f::G]; |
+ Sk4f b4 = srcf[SkPM4f::B]; |
+ Sk4f a4 = srcf[SkPM4f::A]; |
// apply matrix |
Sk4f dst4 = c0 * r4 + c1 * g4 + c2 * b4 + c3 * a4 + c4; |
@@ -122,10 +122,10 @@ void filter_span(const float array[], const T src[], int count, T dst[]) { |
struct SkPMColorAdaptor { |
static SkPMColor From4f(const Sk4f& c4) { |
- return round(c4); |
+ return round(swizzle_rgba_to_pmorder(c4)); |
} |
static Sk4f To4f(SkPMColor c) { |
- return SkNx_cast<float>(Sk4b::Load(&c)) * Sk4f(1.0f/255); |
+ return swizzle_rgba_to_pmorder(to_4f(c)) * Sk4f(1.0f/255); |
mtklein
2016/03/07 18:01:14
Let's not forget to go to one call, e.g. swizzle_i
reed1
2016/03/07 18:47:38
Fixed in newer version.
|
} |
}; |
void SkColorMatrixFilterRowMajor255::filterSpan(const SkPMColor src[], int count, SkPMColor dst[]) const { |
@@ -134,12 +134,10 @@ void SkColorMatrixFilterRowMajor255::filterSpan(const SkPMColor src[], int count |
struct SkPM4fAdaptor { |
static SkPM4f From4f(const Sk4f& c4) { |
- SkPM4f c; |
- c4.store(&c); |
- return c; |
+ return SkPM4f::From4f(c4); |
} |
static Sk4f To4f(const SkPM4f& c) { |
- return Sk4f::Load(&c); |
+ return c.to4f(); |
} |
}; |
void SkColorMatrixFilterRowMajor255::filterSpan4f(const SkPM4f src[], int count, SkPM4f dst[]) const { |