diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-10-04 20:14:57 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-10-04 20:14:57 +0000 |
commit | bbf1226530d1a4e521e40c982f127fd49dbeb6a0 (patch) | |
tree | bdea2798d17727643b5f4cbe3929a39753057871 /gpu | |
parent | 127c3be42b5f07c5ae2f87760a6855c9efecf8a8 (diff) |
fix calculation and assert for grmask -> bytes-per-pixel
git-svn-id: http://skia.googlecode.com/svn/trunk@2407 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gpu')
-rw-r--r-- | gpu/include/GrTypes.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gpu/include/GrTypes.h b/gpu/include/GrTypes.h index c57ed5105b..af43c1f540 100644 --- a/gpu/include/GrTypes.h +++ b/gpu/include/GrTypes.h @@ -249,8 +249,11 @@ enum GrMaskFormat { * Return the number of bytes-per-pixel for the specified mask format. */ static inline int GrMaskFormatBytesPerPixel(GrMaskFormat format) { - GrAssert((unsigned)format <= 1); - return (int)format + 1; + GrAssert((unsigned)format <= 2); + // kA8 (0) -> 1 + // kA565 (1) -> 2 + // kA888 (2) -> 4 + return 1 << (int)format; } /** |