| 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 | |
| 321 // Returns true if the pixel config is 32 bits per pixel | 305 // Returns true if the pixel config is 32 bits per pixel |
| 322 static inline bool GrPixelConfigIs8888(GrPixelConfig config) { | 306 static inline bool GrPixelConfigIs8888(GrPixelConfig config) { |
| 323 switch (config) { | 307 switch (config) { |
| 324 case kRGBA_8888_GrPixelConfig: | 308 case kRGBA_8888_GrPixelConfig: |
| 325 case kBGRA_8888_GrPixelConfig: | 309 case kBGRA_8888_GrPixelConfig: |
| 326 case kSRGBA_8888_GrPixelConfig: | 310 case kSRGBA_8888_GrPixelConfig: |
| 327 return true; | 311 return true; |
| 328 default: | 312 default: |
| 329 return false; | 313 return false; |
| 330 } | 314 } |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 655 public: | 639 public: |
| 656 GrAutoMalloc() : INHERITED() {} | 640 GrAutoMalloc() : INHERITED() {} |
| 657 explicit GrAutoMalloc(size_t size) : INHERITED(size) {} | 641 explicit GrAutoMalloc(size_t size) : INHERITED(size) {} |
| 658 virtual ~GrAutoMalloc() {} | 642 virtual ~GrAutoMalloc() {} |
| 659 private: | 643 private: |
| 660 typedef GrAutoMallocBaseType INHERITED; | 644 typedef GrAutoMallocBaseType INHERITED; |
| 661 }; | 645 }; |
| 662 | 646 |
| 663 #undef GrAutoMallocBaseType | 647 #undef GrAutoMallocBaseType |
| 664 #endif | 648 #endif |
| OLD | NEW |