| 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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 kRGBA_4444_GrPixelConfig, | 264 kRGBA_4444_GrPixelConfig, |
| 265 /** | 265 /** |
| 266 * Premultiplied. Byte order is r,g,b,a. | 266 * Premultiplied. Byte order is r,g,b,a. |
| 267 */ | 267 */ |
| 268 kRGBA_8888_GrPixelConfig, | 268 kRGBA_8888_GrPixelConfig, |
| 269 /** | 269 /** |
| 270 * Premultiplied. Byte order is b,g,r,a. | 270 * Premultiplied. Byte order is b,g,r,a. |
| 271 */ | 271 */ |
| 272 kBGRA_8888_GrPixelConfig, | 272 kBGRA_8888_GrPixelConfig, |
| 273 /** | 273 /** |
| 274 * Premultiplied and sRGB. Byte order is r,g,b,a. |
| 275 */ |
| 276 kSRGBA_8888_GrPixelConfig, |
| 277 /** |
| 274 * ETC1 Compressed Data | 278 * ETC1 Compressed Data |
| 275 */ | 279 */ |
| 276 kETC1_GrPixelConfig, | 280 kETC1_GrPixelConfig, |
| 277 /** | 281 /** |
| 278 * LATC/RGTC/3Dc/BC4 Compressed Data | 282 * LATC/RGTC/3Dc/BC4 Compressed Data |
| 279 */ | 283 */ |
| 280 kLATC_GrPixelConfig, | 284 kLATC_GrPixelConfig, |
| 281 /** | 285 /** |
| 282 * R11 EAC Compressed Data | 286 * R11 EAC Compressed Data |
| 283 * (Corresponds to section C.3.5 of the OpenGL 4.4 core profile spec) | 287 * (Corresponds to section C.3.5 of the OpenGL 4.4 core profile spec) |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 default: | 339 default: |
| 336 return false; | 340 return false; |
| 337 } | 341 } |
| 338 } | 342 } |
| 339 | 343 |
| 340 // Returns true if the pixel config is 32 bits per pixel | 344 // Returns true if the pixel config is 32 bits per pixel |
| 341 static inline bool GrPixelConfigIs8888(GrPixelConfig config) { | 345 static inline bool GrPixelConfigIs8888(GrPixelConfig config) { |
| 342 switch (config) { | 346 switch (config) { |
| 343 case kRGBA_8888_GrPixelConfig: | 347 case kRGBA_8888_GrPixelConfig: |
| 344 case kBGRA_8888_GrPixelConfig: | 348 case kBGRA_8888_GrPixelConfig: |
| 349 case kSRGBA_8888_GrPixelConfig: |
| 345 return true; | 350 return true; |
| 346 default: | 351 default: |
| 347 return false; | 352 return false; |
| 348 } | 353 } |
| 349 } | 354 } |
| 350 | 355 |
| 351 // Takes a config and returns the equivalent config with the R and B order | 356 // Takes a config and returns the equivalent config with the R and B order |
| 352 // swapped if such a config exists. Otherwise, kUnknown_GrPixelConfig | 357 // swapped if such a config exists. Otherwise, kUnknown_GrPixelConfig |
| 353 static inline GrPixelConfig GrPixelConfigSwapRAndB(GrPixelConfig config) { | 358 static inline GrPixelConfig GrPixelConfigSwapRAndB(GrPixelConfig config) { |
| 354 switch (config) { | 359 switch (config) { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 365 SkASSERT(!GrPixelConfigIsCompressed(config)); | 370 SkASSERT(!GrPixelConfigIsCompressed(config)); |
| 366 switch (config) { | 371 switch (config) { |
| 367 case kAlpha_8_GrPixelConfig: | 372 case kAlpha_8_GrPixelConfig: |
| 368 return 1; | 373 return 1; |
| 369 case kRGB_565_GrPixelConfig: | 374 case kRGB_565_GrPixelConfig: |
| 370 case kRGBA_4444_GrPixelConfig: | 375 case kRGBA_4444_GrPixelConfig: |
| 371 case kAlpha_half_GrPixelConfig: | 376 case kAlpha_half_GrPixelConfig: |
| 372 return 2; | 377 return 2; |
| 373 case kRGBA_8888_GrPixelConfig: | 378 case kRGBA_8888_GrPixelConfig: |
| 374 case kBGRA_8888_GrPixelConfig: | 379 case kBGRA_8888_GrPixelConfig: |
| 380 case kSRGBA_8888_GrPixelConfig: |
| 375 return 4; | 381 return 4; |
| 376 case kRGBA_float_GrPixelConfig: | 382 case kRGBA_float_GrPixelConfig: |
| 377 return 16; | 383 return 16; |
| 378 default: | 384 default: |
| 379 return 0; | 385 return 0; |
| 380 } | 386 } |
| 381 } | 387 } |
| 382 | 388 |
| 383 static inline size_t GrUnpackAlignment(GrPixelConfig config) { | 389 static inline size_t GrUnpackAlignment(GrPixelConfig config) { |
| 384 SkASSERT(!GrPixelConfigIsCompressed(config)); | 390 SkASSERT(!GrPixelConfigIsCompressed(config)); |
| 385 switch (config) { | 391 switch (config) { |
| 386 case kAlpha_8_GrPixelConfig: | 392 case kAlpha_8_GrPixelConfig: |
| 387 return 1; | 393 return 1; |
| 388 case kRGB_565_GrPixelConfig: | 394 case kRGB_565_GrPixelConfig: |
| 389 case kRGBA_4444_GrPixelConfig: | 395 case kRGBA_4444_GrPixelConfig: |
| 390 case kAlpha_half_GrPixelConfig: | 396 case kAlpha_half_GrPixelConfig: |
| 391 return 2; | 397 return 2; |
| 392 case kRGBA_8888_GrPixelConfig: | 398 case kRGBA_8888_GrPixelConfig: |
| 393 case kBGRA_8888_GrPixelConfig: | 399 case kBGRA_8888_GrPixelConfig: |
| 400 case kSRGBA_8888_GrPixelConfig: |
| 394 case kRGBA_float_GrPixelConfig: | 401 case kRGBA_float_GrPixelConfig: |
| 395 return 4; | 402 return 4; |
| 396 default: | 403 default: |
| 397 return 0; | 404 return 0; |
| 398 } | 405 } |
| 399 } | 406 } |
| 400 | 407 |
| 401 static inline bool GrPixelConfigIsOpaque(GrPixelConfig config) { | 408 static inline bool GrPixelConfigIsOpaque(GrPixelConfig config) { |
| 402 switch (config) { | 409 switch (config) { |
| 403 case kETC1_GrPixelConfig: | 410 case kETC1_GrPixelConfig: |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 public: | 730 public: |
| 724 GrAutoMalloc() : INHERITED() {} | 731 GrAutoMalloc() : INHERITED() {} |
| 725 explicit GrAutoMalloc(size_t size) : INHERITED(size) {} | 732 explicit GrAutoMalloc(size_t size) : INHERITED(size) {} |
| 726 virtual ~GrAutoMalloc() {} | 733 virtual ~GrAutoMalloc() {} |
| 727 private: | 734 private: |
| 728 typedef GrAutoMallocBaseType INHERITED; | 735 typedef GrAutoMallocBaseType INHERITED; |
| 729 }; | 736 }; |
| 730 | 737 |
| 731 #undef GrAutoMallocBaseType | 738 #undef GrAutoMallocBaseType |
| 732 #endif | 739 #endif |
| OLD | NEW |