OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 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 #ifndef GrTypes_DEFINED | 8 #ifndef GrTypes_DEFINED |
9 #define GrTypes_DEFINED | 9 #define GrTypes_DEFINED |
10 | 10 |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 | 178 |
179 /** | 179 /** |
180 * Return the number of bytes-per-pixel for the specified mask format. | 180 * Return the number of bytes-per-pixel for the specified mask format. |
181 */ | 181 */ |
182 static inline int GrMaskFormatBytesPerPixel(GrMaskFormat format) { | 182 static inline int GrMaskFormatBytesPerPixel(GrMaskFormat format) { |
183 SkASSERT((unsigned)format < kMaskFormatCount); | 183 SkASSERT((unsigned)format < kMaskFormatCount); |
184 // kA8 (0) -> 1 | 184 // kA8 (0) -> 1 |
185 // kA565 (1) -> 2 | 185 // kA565 (1) -> 2 |
186 // kARGB (2) -> 4 | 186 // kARGB (2) -> 4 |
187 static const int sBytesPerPixel[] = { 1, 2, 4 }; | 187 static const int sBytesPerPixel[] = { 1, 2, 4 }; |
188 SK_COMPILE_ASSERT(SK_ARRAY_COUNT(sBytesPerPixel) == kMaskFormatCount, array_
size_mismatch); | 188 static_assert(SK_ARRAY_COUNT(sBytesPerPixel) == kMaskFormatCount, "array_siz
e_mismatch"); |
189 SK_COMPILE_ASSERT(kA8_GrMaskFormat == 0, enum_order_dependency); | 189 static_assert(kA8_GrMaskFormat == 0, "enum_order_dependency"); |
190 SK_COMPILE_ASSERT(kA565_GrMaskFormat == 1, enum_order_dependency); | 190 static_assert(kA565_GrMaskFormat == 1, "enum_order_dependency"); |
191 SK_COMPILE_ASSERT(kARGB_GrMaskFormat == 2, enum_order_dependency); | 191 static_assert(kARGB_GrMaskFormat == 2, "enum_order_dependency"); |
192 | 192 |
193 return sBytesPerPixel[(int) format]; | 193 return sBytesPerPixel[(int) format]; |
194 } | 194 } |
195 | 195 |
196 /** | 196 /** |
197 * Pixel configurations. | 197 * Pixel configurations. |
198 */ | 198 */ |
199 enum GrPixelConfig { | 199 enum GrPixelConfig { |
200 kUnknown_GrPixelConfig, | 200 kUnknown_GrPixelConfig, |
201 kAlpha_8_GrPixelConfig, | 201 kAlpha_8_GrPixelConfig, |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 return 4 * width * height; | 634 return 4 * width * height; |
635 } | 635 } |
636 } | 636 } |
637 | 637 |
638 /** | 638 /** |
639 * This value translates to reseting all the context state for any backend. | 639 * This value translates to reseting all the context state for any backend. |
640 */ | 640 */ |
641 static const uint32_t kAll_GrBackendState = 0xffffffff; | 641 static const uint32_t kAll_GrBackendState = 0xffffffff; |
642 | 642 |
643 #endif | 643 #endif |
OLD | NEW |