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

Unified Diff: src/core/SkPMFloat.h

Issue 1059743002: Use switch operator[](int) to kth<int>() so we can use vget_lane. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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/SkNx.h ('k') | src/opts/SkNx_neon.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPMFloat.h
diff --git a/src/core/SkPMFloat.h b/src/core/SkPMFloat.h
index 84c05ea762f7cd4afd9f24586d9a263ebd231622..b2d9480b819d7cde870d425b4d1c1bb721cf3ce2 100644
--- a/src/core/SkPMFloat.h
+++ b/src/core/SkPMFloat.h
@@ -38,10 +38,10 @@ public:
/*implicit*/ SkPMFloat(const Sk4f& fs) { fColors = fs; }
/*implicit*/ operator Sk4f() const { return fColors; }
- float a() const { return fColors[SK_A32_SHIFT / 8]; }
- float r() const { return fColors[SK_R32_SHIFT / 8]; }
- float g() const { return fColors[SK_G32_SHIFT / 8]; }
- float b() const { return fColors[SK_B32_SHIFT / 8]; }
+ float a() const { return fColors.kth<SK_A32_SHIFT / 8>(); }
+ float r() const { return fColors.kth<SK_R32_SHIFT / 8>(); }
+ float g() const { return fColors.kth<SK_G32_SHIFT / 8>(); }
+ float b() const { return fColors.kth<SK_B32_SHIFT / 8>(); }
// N.B. All methods returning an SkPMColor call SkPMColorAssert on that result before returning.
« no previous file with comments | « src/core/SkNx.h ('k') | src/opts/SkNx_neon.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698