OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 | 10 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 #define GrColorUnpackG(color) (((color) >> GrColor_SHIFT_G) & 0xFF) | 59 #define GrColorUnpackG(color) (((color) >> GrColor_SHIFT_G) & 0xFF) |
60 #define GrColorUnpackB(color) (((color) >> GrColor_SHIFT_B) & 0xFF) | 60 #define GrColorUnpackB(color) (((color) >> GrColor_SHIFT_B) & 0xFF) |
61 #define GrColorUnpackA(color) (((color) >> GrColor_SHIFT_A) & 0xFF) | 61 #define GrColorUnpackA(color) (((color) >> GrColor_SHIFT_A) & 0xFF) |
62 | 62 |
63 /** | 63 /** |
64 * Since premultiplied means that alpha >= color, we construct a color with | 64 * Since premultiplied means that alpha >= color, we construct a color with |
65 * each component==255 and alpha == 0 to be "illegal" | 65 * each component==255 and alpha == 0 to be "illegal" |
66 */ | 66 */ |
67 #define GrColor_ILLEGAL (~(0xFF << GrColor_SHIFT_A)) | 67 #define GrColor_ILLEGAL (~(0xFF << GrColor_SHIFT_A)) |
68 | 68 |
| 69 #define GrColor_WHITE 0xFFFFFFFF |
| 70 #define GrColor_TRANS_BLACK 0x0 |
| 71 |
69 /** | 72 /** |
70 * Assert in debug builds that a GrColor is premultiplied. | 73 * Assert in debug builds that a GrColor is premultiplied. |
71 */ | 74 */ |
72 static inline void GrColorIsPMAssert(GrColor SkDEBUGCODE(c)) { | 75 static inline void GrColorIsPMAssert(GrColor SkDEBUGCODE(c)) { |
73 #ifdef SK_DEBUG | 76 #ifdef SK_DEBUG |
74 unsigned a = GrColorUnpackA(c); | 77 unsigned a = GrColorUnpackA(c); |
75 unsigned r = GrColorUnpackR(c); | 78 unsigned r = GrColorUnpackR(c); |
76 unsigned g = GrColorUnpackG(c); | 79 unsigned g = GrColorUnpackG(c); |
77 unsigned b = GrColorUnpackB(c); | 80 unsigned b = GrColorUnpackB(c); |
78 | 81 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 GR_STATIC_ASSERT(7 == kETC1_GrPixelConfig); | 185 GR_STATIC_ASSERT(7 == kETC1_GrPixelConfig); |
183 GR_STATIC_ASSERT(8 == kLATC_GrPixelConfig); | 186 GR_STATIC_ASSERT(8 == kLATC_GrPixelConfig); |
184 GR_STATIC_ASSERT(9 == kR11_EAC_GrPixelConfig); | 187 GR_STATIC_ASSERT(9 == kR11_EAC_GrPixelConfig); |
185 GR_STATIC_ASSERT(10 == kASTC_12x12_GrPixelConfig); | 188 GR_STATIC_ASSERT(10 == kASTC_12x12_GrPixelConfig); |
186 GR_STATIC_ASSERT(11 == kRGBA_float_GrPixelConfig); | 189 GR_STATIC_ASSERT(11 == kRGBA_float_GrPixelConfig); |
187 GR_STATIC_ASSERT(12 == kAlpha_half_GrPixelConfig); | 190 GR_STATIC_ASSERT(12 == kAlpha_half_GrPixelConfig); |
188 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kFlags) == kGrPixelConfigCnt); | 191 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kFlags) == kGrPixelConfigCnt); |
189 } | 192 } |
190 | 193 |
191 #endif | 194 #endif |
OLD | NEW |