Chromium Code Reviews| Index: include/core/SkImageInfo.h |
| diff --git a/include/core/SkImageInfo.h b/include/core/SkImageInfo.h |
| index 341ec143a2273e22fdc10fdf359c0098b326d114..c51fa4ff82804c138d5bf07a0d0fa1fc0cb6518b 100644 |
| --- a/include/core/SkImageInfo.h |
| +++ b/include/core/SkImageInfo.h |
| @@ -93,22 +93,7 @@ enum SkColorType { |
| #endif |
| }; |
| -static int SkColorTypeBytesPerPixel(SkColorType ct) { |
| - static const uint8_t gSize[] = { |
| - 0, // Unknown |
| - 1, // Alpha_8 |
| - 2, // RGB_565 |
| - 2, // ARGB_4444 |
| - 4, // RGBA_8888 |
| - 4, // BGRA_8888 |
| - 1, // kIndex_8 |
| - }; |
| - SK_COMPILE_ASSERT(SK_ARRAY_COUNT(gSize) == (size_t)(kLastEnum_SkColorType + 1), |
| - size_mismatch_with_SkColorType_enum); |
| - |
| - SkASSERT((size_t)ct < SK_ARRAY_COUNT(gSize)); |
| - return gSize[ct]; |
| -} |
| +int SkColorTypeBytesPerPixel(SkColorType ct); |
| static inline size_t SkColorTypeMinRowBytes(SkColorType ct, int width) { |
| return width * SkColorTypeBytesPerPixel(ct); |
| @@ -242,9 +227,7 @@ public: |
| return SkImageInfo::Make(fWidth, fHeight, newColorType, fAlphaType, fProfileType); |
| } |
| - int bytesPerPixel() const { |
| - return SkColorTypeBytesPerPixel(fColorType); |
| - } |
| + SK_API int bytesPerPixel() const; |
|
dshwang
2015/01/30 21:15:16
move this definition to cpp because SkColorTypeByt
|
| uint64_t minRowBytes64() const { |
| return sk_64_mul(fWidth, this->bytesPerPixel()); |