Index: src/opts/SkPMFloat_none.h |
diff --git a/src/opts/SkPMFloat_none.h b/src/opts/SkPMFloat_none.h |
index c47f8a37132b28c7692acc804fe0e3bf0dc89fc5..00705aa582bdca2dfc09222b5100fd543fe3ce11 100644 |
--- a/src/opts/SkPMFloat_none.h |
+++ b/src/opts/SkPMFloat_none.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) { |
for (int i = 0; i < 4; i++) { fColor[i] = that.fColor[i]; } |
return *this; |
@@ -28,14 +35,28 @@ inline SkPMColor SkPMFloat::clamped() const { |
return SkPackARGB32(a+0.5f, r+0.5f, g+0.5f, b+0.5f); |
} |
-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(); |
} |