Chromium Code Reviews| Index: include/gpu/GrTypes.h |
| diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h |
| index ccc04bce8ae8b6c9a4ee7becac520f2d20e9e978..5f1db4e179fbb2cb3249eb087e257fbc6be7a1c4 100644 |
| --- a/include/gpu/GrTypes.h |
| +++ b/include/gpu/GrTypes.h |
| @@ -239,11 +239,11 @@ static const int kMaskFormatCount = kLast_GrMaskFormat + 1; |
| * Return the number of bytes-per-pixel for the specified mask format. |
| */ |
| static inline int GrMaskFormatBytesPerPixel(GrMaskFormat format) { |
| - SkASSERT((unsigned)format <= 3); |
| // kA8 (0) -> 1 |
| // kA565 (1) -> 2 |
|
robertphillips
2014/11/26 18:19:35
(2) ?
jvanverth1
2014/11/26 19:21:49
Done.
|
| // kARGB (3) -> 4 |
| static const int sBytesPerPixel[] = { 1, 2, 4 }; |
|
robertphillips
2014/11/26 18:19:35
Why SK_ARRAY_COUNT(sBytesPerPixel) instead of kMas
jvanverth1
2014/11/26 19:21:49
Done.
|
| + SkASSERT((unsigned)format < SK_ARRAY_COUNT(sBytesPerPixel)); |
| SK_COMPILE_ASSERT(SK_ARRAY_COUNT(sBytesPerPixel) == kMaskFormatCount, array_size_mismatch); |
|
robertphillips
2014/11/26 18:19:35
Seems like we also need:
SK_COMPILE_ASSERT(kA8_Gr
jvanverth1
2014/11/26 19:21:48
Done.
|
| return sBytesPerPixel[(int) format]; |