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 |
11 #ifndef GrColor_DEFINED | 11 #ifndef GrColor_DEFINED |
12 #define GrColor_DEFINED | 12 #define GrColor_DEFINED |
13 | 13 |
14 #include "GrTypes.h" | 14 #include "GrTypes.h" |
15 #include "SkColor.h" | 15 #include "SkColor.h" |
16 #include "SkColorPriv.h" | 16 #include "SkColorPriv.h" |
17 #include "SkUnPreMultiply.h" | 17 #include "SkUnPreMultiply.h" |
18 | 18 |
19 /** | 19 /** |
20 * GrColor is 4 bytes for R, G, B, A, in a specific order defined below. The com
ponents are stored | 20 * GrColor is 4 bytes for R, G, B, A, in a specific order defined below. Whether
the color is |
21 * premultiplied. | 21 * premultiplied or not depends on the context in which it is being used. |
22 */ | 22 */ |
23 typedef uint32_t GrColor; | 23 typedef uint32_t GrColor; |
24 | 24 |
25 // shift amount to assign a component to a GrColor int | 25 // shift amount to assign a component to a GrColor int |
26 // These shift values are chosen for compatibility with GL attrib arrays | 26 // These shift values are chosen for compatibility with GL attrib arrays |
27 // ES doesn't allow BGRA vertex attrib order so if they were not in this order | 27 // ES doesn't allow BGRA vertex attrib order so if they were not in this order |
28 // we'd have to swizzle in shaders. | 28 // we'd have to swizzle in shaders. |
29 #ifdef SK_CPU_BENDIAN | 29 #ifdef SK_CPU_BENDIAN |
30 #define GrColor_SHIFT_R 24 | 30 #define GrColor_SHIFT_R 24 |
31 #define GrColor_SHIFT_G 16 | 31 #define GrColor_SHIFT_G 16 |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 GR_STATIC_ASSERT(9 == kLATC_GrPixelConfig); | 240 GR_STATIC_ASSERT(9 == kLATC_GrPixelConfig); |
241 GR_STATIC_ASSERT(10 == kR11_EAC_GrPixelConfig); | 241 GR_STATIC_ASSERT(10 == kR11_EAC_GrPixelConfig); |
242 GR_STATIC_ASSERT(11 == kASTC_12x12_GrPixelConfig); | 242 GR_STATIC_ASSERT(11 == kASTC_12x12_GrPixelConfig); |
243 GR_STATIC_ASSERT(12 == kRGBA_float_GrPixelConfig); | 243 GR_STATIC_ASSERT(12 == kRGBA_float_GrPixelConfig); |
244 GR_STATIC_ASSERT(13 == kAlpha_half_GrPixelConfig); | 244 GR_STATIC_ASSERT(13 == kAlpha_half_GrPixelConfig); |
245 GR_STATIC_ASSERT(14 == kRGBA_half_GrPixelConfig); | 245 GR_STATIC_ASSERT(14 == kRGBA_half_GrPixelConfig); |
246 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kFlags) == kGrPixelConfigCnt); | 246 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kFlags) == kGrPixelConfigCnt); |
247 } | 247 } |
248 | 248 |
249 #endif | 249 #endif |
OLD | NEW |