Index: src/opts/SkPMFloat_none.h |
diff --git a/src/opts/SkPMFloat_none.h b/src/opts/SkPMFloat_none.h |
index a11fe241cfa1fe0a5de20d6f535cd44b2ccf80fe..448b509d408e8545c4a25a01d9e30a9db0fae946 100644 |
--- a/src/opts/SkPMFloat_none.h |
+++ b/src/opts/SkPMFloat_none.h |
@@ -1,17 +1,16 @@ |
#include "SkColorPriv.h" |
inline void SkPMFloat::set(SkPMColor c) { |
- float scale = 1.0f / 255.0f; |
- this->setA(SkGetPackedA32(c) * scale); |
- this->setR(SkGetPackedR32(c) * scale); |
- this->setG(SkGetPackedG32(c) * scale); |
- this->setB(SkGetPackedB32(c) * scale); |
+ this->setA(SkGetPackedA32(c)); |
+ this->setR(SkGetPackedR32(c)); |
+ this->setG(SkGetPackedG32(c)); |
+ this->setB(SkGetPackedB32(c)); |
SkASSERT(this->isValid()); |
} |
inline SkPMColor SkPMFloat::get() const { |
SkASSERT(this->isValid()); |
- return SkPackARGB32(this->a() * 255, this->r() * 255, this->g() * 255, this->b() * 255); |
+ return SkPackARGB32(this->a(), this->r(), this->g(), this->b()); |
} |
inline SkPMColor SkPMFloat::clamped() const { |
@@ -19,9 +18,9 @@ inline SkPMColor SkPMFloat::clamped() const { |
r = this->r(), |
g = this->g(), |
b = this->b(); |
- a = a < 0 ? 0 : (a > 1 ? 1 : a); |
- r = r < 0 ? 0 : (r > 1 ? 1 : r); |
- g = g < 0 ? 0 : (g > 1 ? 1 : g); |
- b = b < 0 ? 0 : (b > 1 ? 1 : b); |
- return SkPackARGB32(a * 255, r * 255, g * 255, b * 255); |
+ a = a < 0 ? 0 : (a > 255 ? 255 : a); |
+ r = r < 0 ? 0 : (r > 255 ? 255 : r); |
+ g = g < 0 ? 0 : (g > 255 ? 255 : g); |
+ b = b < 0 ? 0 : (b > 255 ? 255 : b); |
+ return SkPackARGB32(a, r, g, b); |
} |