| 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 |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 }; | 222 }; |
| 223 static const int kPublicGrBlendCoeffCount = kLastPublicGrBlendCoeff + 1; | 223 static const int kPublicGrBlendCoeffCount = kLastPublicGrBlendCoeff + 1; |
| 224 | 224 |
| 225 /** | 225 /** |
| 226 * Formats for masks, used by the font cache. | 226 * Formats for masks, used by the font cache. |
| 227 * Important that these are 0-based. | 227 * Important that these are 0-based. |
| 228 */ | 228 */ |
| 229 enum GrMaskFormat { | 229 enum GrMaskFormat { |
| 230 kA8_GrMaskFormat, //!< 1-byte per pixel | 230 kA8_GrMaskFormat, //!< 1-byte per pixel |
| 231 kA565_GrMaskFormat, //!< 2-bytes per pixel | 231 kA565_GrMaskFormat, //!< 2-bytes per pixel |
| 232 kA888_GrMaskFormat, //!< 4-bytes per pixel | |
| 233 kARGB_GrMaskFormat, //!< 4-bytes per pixel, color format | 232 kARGB_GrMaskFormat, //!< 4-bytes per pixel, color format |
| 234 | 233 |
| 235 kLast_GrMaskFormat = kARGB_GrMaskFormat | 234 kLast_GrMaskFormat = kARGB_GrMaskFormat |
| 236 }; | 235 }; |
| 237 static const int kMaskFormatCount = kLast_GrMaskFormat + 1; | 236 static const int kMaskFormatCount = kLast_GrMaskFormat + 1; |
| 238 | 237 |
| 239 /** | 238 /** |
| 240 * Return the number of bytes-per-pixel for the specified mask format. | 239 * Return the number of bytes-per-pixel for the specified mask format. |
| 241 */ | 240 */ |
| 242 static inline int GrMaskFormatBytesPerPixel(GrMaskFormat format) { | 241 static inline int GrMaskFormatBytesPerPixel(GrMaskFormat format) { |
| 243 SkASSERT((unsigned)format <= 3); | 242 SkASSERT((unsigned)format <= 3); |
| 244 // kA8 (0) -> 1 | 243 // kA8 (0) -> 1 |
| 245 // kA565 (1) -> 2 | 244 // kA565 (1) -> 2 |
| 246 // kA888 (2) -> 4 | |
| 247 // kARGB (3) -> 4 | 245 // kARGB (3) -> 4 |
| 248 static const int sBytesPerPixel[] = { 1, 2, 4, 4 }; | 246 static const int sBytesPerPixel[] = { 1, 2, 4 }; |
| 249 SK_COMPILE_ASSERT(SK_ARRAY_COUNT(sBytesPerPixel) == kMaskFormatCount, array_
size_mismatch); | 247 SK_COMPILE_ASSERT(SK_ARRAY_COUNT(sBytesPerPixel) == kMaskFormatCount, array_
size_mismatch); |
| 250 | 248 |
| 251 return sBytesPerPixel[(int) format]; | 249 return sBytesPerPixel[(int) format]; |
| 252 } | 250 } |
| 253 | 251 |
| 254 /** | 252 /** |
| 255 * Pixel configurations. | 253 * Pixel configurations. |
| 256 */ | 254 */ |
| 257 enum GrPixelConfig { | 255 enum GrPixelConfig { |
| 258 kUnknown_GrPixelConfig, | 256 kUnknown_GrPixelConfig, |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 public: | 713 public: |
| 716 GrAutoMalloc() : INHERITED() {} | 714 GrAutoMalloc() : INHERITED() {} |
| 717 explicit GrAutoMalloc(size_t size) : INHERITED(size) {} | 715 explicit GrAutoMalloc(size_t size) : INHERITED(size) {} |
| 718 virtual ~GrAutoMalloc() {} | 716 virtual ~GrAutoMalloc() {} |
| 719 private: | 717 private: |
| 720 typedef GrAutoMallocBaseType INHERITED; | 718 typedef GrAutoMallocBaseType INHERITED; |
| 721 }; | 719 }; |
| 722 | 720 |
| 723 #undef GrAutoMallocBaseType | 721 #undef GrAutoMallocBaseType |
| 724 #endif | 722 #endif |
| OLD | NEW |