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 #ifndef GrTypes_DEFINED | 9 #ifndef GrTypes_DEFINED |
10 #define GrTypes_DEFINED | 10 #define GrTypes_DEFINED |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 /** | 243 /** |
244 * Byte order is r, g, b, a. This color format is 32 bits per channel | 244 * Byte order is r, g, b, a. This color format is 32 bits per channel |
245 */ | 245 */ |
246 kRGBA_float_GrPixelConfig, | 246 kRGBA_float_GrPixelConfig, |
247 | 247 |
248 /** | 248 /** |
249 * This color format is a single 16 bit float channel | 249 * This color format is a single 16 bit float channel |
250 */ | 250 */ |
251 kAlpha_half_GrPixelConfig, | 251 kAlpha_half_GrPixelConfig, |
252 | 252 |
253 kLast_GrPixelConfig = kAlpha_half_GrPixelConfig | 253 /** |
| 254 * Byte order is r, g, b, a. This color format is 16 bits per channel |
| 255 */ |
| 256 kRGBA_half_GrPixelConfig, |
| 257 |
| 258 kLast_GrPixelConfig = kRGBA_half_GrPixelConfig |
254 }; | 259 }; |
255 static const int kGrPixelConfigCnt = kLast_GrPixelConfig + 1; | 260 static const int kGrPixelConfigCnt = kLast_GrPixelConfig + 1; |
256 | 261 |
257 // Aliases for pixel configs that match skia's byte order. | 262 // Aliases for pixel configs that match skia's byte order. |
258 #ifndef SK_CPU_LENDIAN | 263 #ifndef SK_CPU_LENDIAN |
259 #error "Skia gpu currently assumes little endian" | 264 #error "Skia gpu currently assumes little endian" |
260 #endif | 265 #endif |
261 #if SK_PMCOLOR_BYTE_ORDER(B,G,R,A) | 266 #if SK_PMCOLOR_BYTE_ORDER(B,G,R,A) |
262 static const GrPixelConfig kSkia8888_GrPixelConfig = kBGRA_8888_GrPixelConfi
g; | 267 static const GrPixelConfig kSkia8888_GrPixelConfig = kBGRA_8888_GrPixelConfi
g; |
263 #elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A) | 268 #elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A) |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 case kAlpha_8_GrPixelConfig: | 333 case kAlpha_8_GrPixelConfig: |
329 return 1; | 334 return 1; |
330 case kRGB_565_GrPixelConfig: | 335 case kRGB_565_GrPixelConfig: |
331 case kRGBA_4444_GrPixelConfig: | 336 case kRGBA_4444_GrPixelConfig: |
332 case kAlpha_half_GrPixelConfig: | 337 case kAlpha_half_GrPixelConfig: |
333 return 2; | 338 return 2; |
334 case kRGBA_8888_GrPixelConfig: | 339 case kRGBA_8888_GrPixelConfig: |
335 case kBGRA_8888_GrPixelConfig: | 340 case kBGRA_8888_GrPixelConfig: |
336 case kSRGBA_8888_GrPixelConfig: | 341 case kSRGBA_8888_GrPixelConfig: |
337 return 4; | 342 return 4; |
| 343 case kRGBA_half_GrPixelConfig: |
| 344 return 8; |
338 case kRGBA_float_GrPixelConfig: | 345 case kRGBA_float_GrPixelConfig: |
339 return 16; | 346 return 16; |
340 default: | 347 default: |
341 return 0; | 348 return 0; |
342 } | 349 } |
343 } | 350 } |
344 | 351 |
345 static inline size_t GrUnpackAlignment(GrPixelConfig config) { | 352 static inline size_t GrUnpackAlignment(GrPixelConfig config) { |
346 SkASSERT(!GrPixelConfigIsCompressed(config)); | 353 SkASSERT(!GrPixelConfigIsCompressed(config)); |
347 switch (config) { | 354 switch (config) { |
348 case kAlpha_8_GrPixelConfig: | 355 case kAlpha_8_GrPixelConfig: |
349 return 1; | 356 return 1; |
350 case kRGB_565_GrPixelConfig: | 357 case kRGB_565_GrPixelConfig: |
351 case kRGBA_4444_GrPixelConfig: | 358 case kRGBA_4444_GrPixelConfig: |
352 case kAlpha_half_GrPixelConfig: | 359 case kAlpha_half_GrPixelConfig: |
| 360 case kRGBA_half_GrPixelConfig: |
353 return 2; | 361 return 2; |
354 case kRGBA_8888_GrPixelConfig: | 362 case kRGBA_8888_GrPixelConfig: |
355 case kBGRA_8888_GrPixelConfig: | 363 case kBGRA_8888_GrPixelConfig: |
356 case kSRGBA_8888_GrPixelConfig: | 364 case kSRGBA_8888_GrPixelConfig: |
357 case kRGBA_float_GrPixelConfig: | 365 case kRGBA_float_GrPixelConfig: |
358 return 4; | 366 return 4; |
359 default: | 367 default: |
360 return 0; | 368 return 0; |
361 } | 369 } |
362 } | 370 } |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 public: | 628 public: |
621 GrAutoMalloc() : INHERITED() {} | 629 GrAutoMalloc() : INHERITED() {} |
622 explicit GrAutoMalloc(size_t size) : INHERITED(size) {} | 630 explicit GrAutoMalloc(size_t size) : INHERITED(size) {} |
623 virtual ~GrAutoMalloc() {} | 631 virtual ~GrAutoMalloc() {} |
624 private: | 632 private: |
625 typedef GrAutoMallocBaseType INHERITED; | 633 typedef GrAutoMallocBaseType INHERITED; |
626 }; | 634 }; |
627 | 635 |
628 #undef GrAutoMallocBaseType | 636 #undef GrAutoMallocBaseType |
629 #endif | 637 #endif |
OLD | NEW |