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 inline SkPMFloat& SkPMFloat::operator=(const SkPMFloat& that) { | |
9 for (int i = 0; i < 4; i++) { fColor[i] = that.fColor[i]; } | |
10 return *this; | |
11 } | |
12 | |
13 inline SkPMFloat::SkPMFloat(SkPMColor c) { | 8 inline SkPMFloat::SkPMFloat(SkPMColor c) { |
14 *this = SkPMFloat::FromARGB(SkGetPackedA32(c), | 9 *this = SkPMFloat::FromARGB(SkGetPackedA32(c), |
15 SkGetPackedR32(c), | 10 SkGetPackedR32(c), |
16 SkGetPackedG32(c), | 11 SkGetPackedG32(c), |
17 SkGetPackedB32(c)); | 12 SkGetPackedB32(c)); |
18 SkASSERT(this->isValid()); | 13 SkASSERT(this->isValid()); |
19 } | 14 } |
20 | 15 |
21 inline SkPMColor SkPMFloat::trunc() const { | 16 inline SkPMColor SkPMFloat::trunc() const { |
22 return SkPackARGB32(this->a(), this->r(), this->g(), this->b()); | 17 return SkPackARGB32(this->a(), this->r(), this->g(), this->b()); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 } | 52 } |
58 | 53 |
59 inline void SkPMFloat::ClampTo4PMColors( | 54 inline void SkPMFloat::ClampTo4PMColors( |
60 const SkPMFloat& a, const SkPMFloat& b, const SkPMFloat&c, const SkPMFlo
at& d, | 55 const SkPMFloat& a, const SkPMFloat& b, const SkPMFloat&c, const SkPMFlo
at& d, |
61 SkPMColor colors[4]) { | 56 SkPMColor colors[4]) { |
62 colors[0] = a.clamped(); | 57 colors[0] = a.clamped(); |
63 colors[1] = b.clamped(); | 58 colors[1] = b.clamped(); |
64 colors[2] = c.clamped(); | 59 colors[2] = c.clamped(); |
65 colors[3] = d.clamped(); | 60 colors[3] = d.clamped(); |
66 } | 61 } |
OLD | NEW |