Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Unified Diff: src/core/SkColorMatrixFilterRowMajor255.cpp

Issue 1714363002: SkNx: kth<...>() -> [...] (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: the rest Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkColor.cpp ('k') | src/core/SkGeometry.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkColorMatrixFilterRowMajor255.cpp
diff --git a/src/core/SkColorMatrixFilterRowMajor255.cpp b/src/core/SkColorMatrixFilterRowMajor255.cpp
index ff95bf1ac5cd558dd4e58e3685fcb885017f0c55..e2545c2af6f7f340a0d4c240bf70495ba2f5fceb 100644
--- a/src/core/SkColorMatrixFilterRowMajor255.cpp
+++ b/src/core/SkColorMatrixFilterRowMajor255.cpp
@@ -66,11 +66,11 @@ static Sk4f scale_rgb(float scale) {
}
static Sk4f premul(const Sk4f& x) {
- return x * scale_rgb(x.kth<SkPM4f::A>());
+ return x * scale_rgb(x[SkPM4f::A]);
}
static Sk4f unpremul(const Sk4f& x) {
- return x * scale_rgb(1 / x.kth<SkPM4f::A>()); // TODO: fast/approx invert?
+ return x * scale_rgb(1 / x[SkPM4f::A]); // TODO: fast/approx invert?
}
static Sk4f clamp_0_1(const Sk4f& x) {
@@ -98,7 +98,7 @@ void filter_span(const float array[], const T src[], int count, T dst[]) {
for (int i = 0; i < count; i++) {
Sk4f srcf = Adaptor::To4f(src[i]);
- float srcA = srcf.kth<SkPM4f::A>();
+ float srcA = srcf[SkPM4f::A];
if (0 == srcA) {
dst[i] = matrix_translate_pmcolor;
@@ -108,10 +108,10 @@ void filter_span(const float array[], const T src[], int count, T dst[]) {
srcf = unpremul(srcf);
}
- Sk4f r4 = srcf.kth<SK_R32_SHIFT/8>();
- Sk4f g4 = srcf.kth<SK_G32_SHIFT/8>();
- Sk4f b4 = srcf.kth<SK_B32_SHIFT/8>();
- Sk4f a4 = srcf.kth<SK_A32_SHIFT/8>();
+ 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];
// apply matrix
Sk4f dst4 = c0 * r4 + c1 * g4 + c2 * b4 + c3 * a4 + c4;
« no previous file with comments | « src/core/SkColor.cpp ('k') | src/core/SkGeometry.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698