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

Unified Diff: src/opts/SkPMFloat_neon.h

Issue 1035583002: Update 4-at-a-time APIs. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: (C) 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/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 6c9df37e5107b018847a09b71e7b6585eb2bc4d3..780981bd9555192961950dec0813aa19fee3f69b 100644
--- a/src/opts/SkPMFloat_neon.h
+++ b/src/opts/SkPMFloat_neon.h
@@ -1,3 +1,10 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
inline SkPMFloat& SkPMFloat::operator=(const SkPMFloat& that) {
fColors = that.fColors;
return *this;
@@ -41,14 +48,28 @@ inline SkPMColor SkPMFloat::clamped() const {
}
// 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::From4PMColors(const SkPMColor colors[4],
+ SkPMFloat* a, SkPMFloat* b, SkPMFloat* c, SkPMFloat* d) {
+ *a = FromPMColor(colors[0]);
+ *b = FromPMColor(colors[1]);
+ *c = FromPMColor(colors[2]);
+ *d = FromPMColor(colors[3]);
}
-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::To4PMColors(
+ const SkPMFloat& a, const SkPMFloat& b, const SkPMFloat&c, const SkPMFloat& d,
+ SkPMColor colors[4]) {
+ colors[0] = a.get();
+ colors[1] = b.get();
+ colors[2] = c.get();
+ colors[3] = d.get();
}
-inline void SkPMFloat::ClampTo4PMColors(SkPMColor colors[4], const SkPMFloat floats[4]) {
- for (int i = 0; i < 4; i++) { colors[i] = floats[i].clamped(); }
+inline void SkPMFloat::ClampTo4PMColors(
+ const SkPMFloat& a, const SkPMFloat& b, const SkPMFloat&c, const SkPMFloat& d,
+ SkPMColor colors[4]) {
+ colors[0] = a.clamped();
+ colors[1] = b.clamped();
+ colors[2] = c.clamped();
+ colors[3] = d.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