| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkImageInfo_DEFINED | 8 #ifndef SkImageInfo_DEFINED |
| 9 #define SkImageInfo_DEFINED | 9 #define SkImageInfo_DEFINED |
| 10 | 10 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 } | 60 } |
| 61 | 61 |
| 62 static inline bool SkAlphaTypeIsValid(unsigned value) { | 62 static inline bool SkAlphaTypeIsValid(unsigned value) { |
| 63 return value <= kLastEnum_SkAlphaType; | 63 return value <= kLastEnum_SkAlphaType; |
| 64 } | 64 } |
| 65 | 65 |
| 66 /////////////////////////////////////////////////////////////////////////////// | 66 /////////////////////////////////////////////////////////////////////////////// |
| 67 | 67 |
| 68 /** | 68 /** |
| 69 * Describes how to interpret the components of a pixel. | 69 * Describes how to interpret the components of a pixel. |
| 70 * |
| 71 * kN32_SkColorType is an alias for whichever 32bit ARGB format is the "native" |
| 72 * form for skia's blitters. Use this if you don't have a swizzle preference |
| 73 * for 32bit pixels. |
| 70 */ | 74 */ |
| 71 enum SkColorType { | 75 enum SkColorType { |
| 72 kUnknown_SkColorType, | 76 kUnknown_SkColorType, |
| 73 kAlpha_8_SkColorType, | 77 kAlpha_8_SkColorType, |
| 74 kRGB_565_SkColorType, | 78 kRGB_565_SkColorType, |
| 75 kARGB_4444_SkColorType, | 79 kARGB_4444_SkColorType, |
| 76 kRGBA_8888_SkColorType, | 80 kRGBA_8888_SkColorType, |
| 77 kBGRA_8888_SkColorType, | 81 kBGRA_8888_SkColorType, |
| 78 kIndex_8_SkColorType, | 82 kIndex_8_SkColorType, |
| 79 | 83 |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 | 243 |
| 240 bool validRowBytes(size_t rowBytes) const { | 244 bool validRowBytes(size_t rowBytes) const { |
| 241 uint64_t rb = sk_64_mul(fWidth, this->bytesPerPixel()); | 245 uint64_t rb = sk_64_mul(fWidth, this->bytesPerPixel()); |
| 242 return rowBytes >= rb; | 246 return rowBytes >= rb; |
| 243 } | 247 } |
| 244 | 248 |
| 245 SkDEBUGCODE(void validate() const;) | 249 SkDEBUGCODE(void validate() const;) |
| 246 }; | 250 }; |
| 247 | 251 |
| 248 #endif | 252 #endif |
| OLD | NEW |