OLD | NEW |
1 | |
2 /* | 1 /* |
3 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
4 * | 3 * |
5 * 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 |
6 * found in the LICENSE file. | 5 * found in the LICENSE file. |
7 */ | 6 */ |
8 | 7 |
9 | |
10 #include "SkColor.h" | 8 #include "SkColor.h" |
11 #include "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
| 10 #include "SkFixed.h" |
12 | 11 |
13 SkPMColor SkPreMultiplyARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b) { | 12 SkPMColor SkPreMultiplyARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b) { |
14 return SkPremultiplyARGBInline(a, r, g, b); | 13 return SkPremultiplyARGBInline(a, r, g, b); |
15 } | 14 } |
16 | 15 |
17 SkPMColor SkPreMultiplyColor(SkColor c) { | 16 SkPMColor SkPreMultiplyColor(SkColor c) { |
18 return SkPremultiplyARGBInline(SkColorGetA(c), SkColorGetR(c), | 17 return SkPremultiplyARGBInline(SkColorGetA(c), SkColorGetR(c), |
19 SkColorGetG(c), SkColorGetB(c)); | 18 SkColorGetG(c), SkColorGetB(c)); |
20 } | 19 } |
21 | 20 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 switch (hx >> 16) { | 103 switch (hx >> 16) { |
105 case 0: r = v; g = t; b = p; break; | 104 case 0: r = v; g = t; b = p; break; |
106 case 1: r = q; g = v; b = p; break; | 105 case 1: r = q; g = v; b = p; break; |
107 case 2: r = p; g = v; b = t; break; | 106 case 2: r = p; g = v; b = t; break; |
108 case 3: r = p; g = q; b = v; break; | 107 case 3: r = p; g = q; b = v; break; |
109 case 4: r = t; g = p; b = v; break; | 108 case 4: r = t; g = p; b = v; break; |
110 default: r = v; g = p; b = q; break; | 109 default: r = v; g = p; b = q; break; |
111 } | 110 } |
112 return SkColorSetARGB(a, r, g, b); | 111 return SkColorSetARGB(a, r, g, b); |
113 } | 112 } |
OLD | NEW |