Chromium Code Reviews| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 98 0, // Unknown | 98 0, // Unknown |
| 99 1, // Alpha_8 | 99 1, // Alpha_8 |
| 100 2, // RGB_565 | 100 2, // RGB_565 |
| 101 2, // ARGB_4444 | 101 2, // ARGB_4444 |
| 102 4, // RGBA_8888 | 102 4, // RGBA_8888 |
| 103 4, // BGRA_8888 | 103 4, // BGRA_8888 |
| 104 1, // kIndex_8 | 104 1, // kIndex_8 |
| 105 }; | 105 }; |
| 106 SK_COMPILE_ASSERT(SK_ARRAY_COUNT(gSize) == (size_t)(kLastEnum_SkColorType + 1), | 106 SK_COMPILE_ASSERT(SK_ARRAY_COUNT(gSize) == (size_t)(kLastEnum_SkColorType + 1), |
| 107 size_mismatch_with_SkColorType_enum); | 107 size_mismatch_with_SkColorType_enum); |
| 108 | |
| 109 SkASSERT((size_t)ct < SK_ARRAY_COUNT(gSize)); | |
|
dshwang
2015/01/23 15:37:48
I think this ASSERT is covered by above SK_COMPILE
bsalomon
2015/01/23 15:55:50
I believe the assert is to guard against the case
| |
| 110 return gSize[ct]; | 108 return gSize[ct]; |
| 111 } | 109 } |
| 112 | 110 |
| 113 static inline size_t SkColorTypeMinRowBytes(SkColorType ct, int width) { | 111 static inline size_t SkColorTypeMinRowBytes(SkColorType ct, int width) { |
| 114 return width * SkColorTypeBytesPerPixel(ct); | 112 return width * SkColorTypeBytesPerPixel(ct); |
| 115 } | 113 } |
| 116 | 114 |
| 117 static inline bool SkColorTypeIsValid(unsigned value) { | 115 static inline bool SkColorTypeIsValid(unsigned value) { |
| 118 return value <= kLastEnum_SkColorType; | 116 return value <= kLastEnum_SkColorType; |
| 119 } | 117 } |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 298 , fHeight(height) | 296 , fHeight(height) |
| 299 , fColorType(ct) | 297 , fColorType(ct) |
| 300 , fAlphaType(at) | 298 , fAlphaType(at) |
| 301 , fProfileType(pt) | 299 , fProfileType(pt) |
| 302 {} | 300 {} |
| 303 | 301 |
| 304 SkColorProfileType fProfileType; | 302 SkColorProfileType fProfileType; |
| 305 }; | 303 }; |
| 306 | 304 |
| 307 #endif | 305 #endif |
| OLD | NEW |