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

Unified Diff: src/opts/SkPMFloat_neon.h

Issue 982123002: SKPMFloat: we can beat the naive loops when clamping (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: restore some asserts Created 5 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/opts/SkPMFloat_SSSE3.h ('k') | src/opts/SkPMFloat_none.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/opts/SkPMFloat_neon.h
diff --git a/src/opts/SkPMFloat_neon.h b/src/opts/SkPMFloat_neon.h
index 48cc568d031244a87196cfd65a967704da512e78..036d10d0d6e152c2d4f1f7c9fd569db2f51cfaa3 100644
--- a/src/opts/SkPMFloat_neon.h
+++ b/src/opts/SkPMFloat_neon.h
@@ -37,3 +37,16 @@ inline SkPMColor SkPMFloat::clamped() const {
SkPMColorAssert(c);
return c;
}
+
+// TODO: we should be able to beat these loops on all three methods.
+inline void SkPMFloat::From4PMColors(SkPMFloat floats[4], const SkPMColor colors[4]) {
+ for (int i = 0; i < 4; i++) { floats[i] = FromPMColor(colors[i]); }
+}
+
+inline void SkPMFloat::To4PMColors(SkPMColor colors[4], const SkPMFloat floats[4]) {
+ for (int i = 0; i < 4; i++) { colors[i] = floats[i].get(); }
+}
+
+inline void SkPMFloat::ClampTo4PMColors(SkPMColor colors[4], const SkPMFloat floats[4]) {
+ for (int i = 0; i < 4; i++) { colors[i] = floats[i].clamped(); }
+}
« no previous file with comments | « src/opts/SkPMFloat_SSSE3.h ('k') | src/opts/SkPMFloat_none.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698