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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 case kETC1_GrPixelConfig: | 295 case kETC1_GrPixelConfig: |
296 case kLATC_GrPixelConfig: | 296 case kLATC_GrPixelConfig: |
297 case kR11_EAC_GrPixelConfig: | 297 case kR11_EAC_GrPixelConfig: |
298 case kASTC_12x12_GrPixelConfig: | 298 case kASTC_12x12_GrPixelConfig: |
299 return true; | 299 return true; |
300 default: | 300 default: |
301 return false; | 301 return false; |
302 } | 302 } |
303 } | 303 } |
304 | 304 |
| 305 /** If the pixel config is compressed, return an equivalent uncompressed format.
*/ |
| 306 static inline GrPixelConfig GrMakePixelConfigUncompressed(GrPixelConfig config)
{ |
| 307 switch (config) { |
| 308 case kIndex_8_GrPixelConfig: |
| 309 case kETC1_GrPixelConfig: |
| 310 case kASTC_12x12_GrPixelConfig: |
| 311 return kRGBA_8888_GrPixelConfig; |
| 312 case kLATC_GrPixelConfig: |
| 313 case kR11_EAC_GrPixelConfig: |
| 314 return kAlpha_8_GrPixelConfig; |
| 315 default: |
| 316 SkASSERT(!GrPixelConfigIsCompressed(config)); |
| 317 return config; |
| 318 } |
| 319 } |
| 320 |
305 // Returns true if the pixel config is 32 bits per pixel | 321 // Returns true if the pixel config is 32 bits per pixel |
306 static inline bool GrPixelConfigIs8888(GrPixelConfig config) { | 322 static inline bool GrPixelConfigIs8888(GrPixelConfig config) { |
307 switch (config) { | 323 switch (config) { |
308 case kRGBA_8888_GrPixelConfig: | 324 case kRGBA_8888_GrPixelConfig: |
309 case kBGRA_8888_GrPixelConfig: | 325 case kBGRA_8888_GrPixelConfig: |
310 case kSRGBA_8888_GrPixelConfig: | 326 case kSRGBA_8888_GrPixelConfig: |
311 return true; | 327 return true; |
312 default: | 328 default: |
313 return false; | 329 return false; |
314 } | 330 } |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 public: | 655 public: |
640 GrAutoMalloc() : INHERITED() {} | 656 GrAutoMalloc() : INHERITED() {} |
641 explicit GrAutoMalloc(size_t size) : INHERITED(size) {} | 657 explicit GrAutoMalloc(size_t size) : INHERITED(size) {} |
642 virtual ~GrAutoMalloc() {} | 658 virtual ~GrAutoMalloc() {} |
643 private: | 659 private: |
644 typedef GrAutoMallocBaseType INHERITED; | 660 typedef GrAutoMallocBaseType INHERITED; |
645 }; | 661 }; |
646 | 662 |
647 #undef GrAutoMallocBaseType | 663 #undef GrAutoMallocBaseType |
648 #endif | 664 #endif |
OLD | NEW |