OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
| 8 namespace { // See SkPMFloat.h |
| 9 |
8 inline SkPMFloat::SkPMFloat(SkPMColor c) { | 10 inline SkPMFloat::SkPMFloat(SkPMColor c) { |
9 *this = SkPMFloat::FromARGB(SkGetPackedA32(c), | 11 *this = SkPMFloat::FromARGB(SkGetPackedA32(c), |
10 SkGetPackedR32(c), | 12 SkGetPackedR32(c), |
11 SkGetPackedG32(c), | 13 SkGetPackedG32(c), |
12 SkGetPackedB32(c)); | 14 SkGetPackedB32(c)); |
13 SkASSERT(this->isValid()); | 15 SkASSERT(this->isValid()); |
14 } | 16 } |
15 | 17 |
16 inline SkPMColor SkPMFloat::trunc() const { | 18 inline SkPMColor SkPMFloat::trunc() const { |
17 return SkPackARGB32(this->a(), this->r(), this->g(), this->b()); | 19 return SkPackARGB32(this->a(), this->r(), this->g(), this->b()); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 } | 57 } |
56 | 58 |
57 inline void SkPMFloat::RoundClampTo4PMColors( | 59 inline void SkPMFloat::RoundClampTo4PMColors( |
58 const SkPMFloat& a, const SkPMFloat& b, const SkPMFloat&c, const SkPMFlo
at& d, | 60 const SkPMFloat& a, const SkPMFloat& b, const SkPMFloat&c, const SkPMFlo
at& d, |
59 SkPMColor colors[4]) { | 61 SkPMColor colors[4]) { |
60 colors[0] = a.roundClamp(); | 62 colors[0] = a.roundClamp(); |
61 colors[1] = b.roundClamp(); | 63 colors[1] = b.roundClamp(); |
62 colors[2] = c.roundClamp(); | 64 colors[2] = c.roundClamp(); |
63 colors[3] = d.roundClamp(); | 65 colors[3] = d.roundClamp(); |
64 } | 66 } |
| 67 |
| 68 } // namespace |
OLD | NEW |