| 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 | 59 |
| 60 /** | 60 /** |
| 61 * Since premultiplied means that alpha >= color, we construct a color with | 61 * Since premultiplied means that alpha >= color, we construct a color with |
| 62 * each component==255 and alpha == 0 to be "illegal" | 62 * each component==255 and alpha == 0 to be "illegal" |
| 63 */ | 63 */ |
| 64 #define GrColor_ILLEGAL (~(0xFF << GrColor_SHIFT_A)) | 64 #define GrColor_ILLEGAL (~(0xFF << GrColor_SHIFT_A)) |
| 65 | 65 |
| 66 /** | 66 /** |
| 67 * Assert in debug builds that a GrColor is premultiplied. | 67 * Assert in debug builds that a GrColor is premultiplied. |
| 68 */ | 68 */ |
| 69 static inline void GrColorIsPMAssert(GrColor c) { | 69 static inline void GrColorIsPMAssert(GrColor SkDEBUGCODE(c)) { |
| 70 #ifdef SK_DEBUG | 70 #ifdef SK_DEBUG |
| 71 unsigned a = GrColorUnpackA(c); | 71 unsigned a = GrColorUnpackA(c); |
| 72 unsigned r = GrColorUnpackR(c); | 72 unsigned r = GrColorUnpackR(c); |
| 73 unsigned g = GrColorUnpackG(c); | 73 unsigned g = GrColorUnpackG(c); |
| 74 unsigned b = GrColorUnpackB(c); | 74 unsigned b = GrColorUnpackB(c); |
| 75 | 75 |
| 76 SkASSERT(r <= a); | 76 SkASSERT(r <= a); |
| 77 SkASSERT(g <= a); | 77 SkASSERT(g <= a); |
| 78 SkASSERT(b <= a); | 78 SkASSERT(b <= a); |
| 79 #endif | 79 #endif |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 GR_STATIC_ASSERT(6 == kBGRA_8888_GrPixelConfig); | 160 GR_STATIC_ASSERT(6 == kBGRA_8888_GrPixelConfig); |
| 161 GR_STATIC_ASSERT(7 == kETC1_GrPixelConfig); | 161 GR_STATIC_ASSERT(7 == kETC1_GrPixelConfig); |
| 162 GR_STATIC_ASSERT(8 == kLATC_GrPixelConfig); | 162 GR_STATIC_ASSERT(8 == kLATC_GrPixelConfig); |
| 163 GR_STATIC_ASSERT(9 == kR11_EAC_GrPixelConfig); | 163 GR_STATIC_ASSERT(9 == kR11_EAC_GrPixelConfig); |
| 164 GR_STATIC_ASSERT(10 == kASTC_12x12_GrPixelConfig); | 164 GR_STATIC_ASSERT(10 == kASTC_12x12_GrPixelConfig); |
| 165 GR_STATIC_ASSERT(11 == kRGBA_float_GrPixelConfig); | 165 GR_STATIC_ASSERT(11 == kRGBA_float_GrPixelConfig); |
| 166 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kFlags) == kGrPixelConfigCnt); | 166 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kFlags) == kGrPixelConfigCnt); |
| 167 } | 167 } |
| 168 | 168 |
| 169 #endif | 169 #endif |
| OLD | NEW |