diff options
author | 2011-03-10 15:06:27 +0000 | |
---|---|---|
committer | 2011-03-10 15:06:27 +0000 | |
commit | f88d6765a594cf9fb0825b74779f74394a7ccc7a (patch) | |
tree | 6c5a17f3e28e9eb8452d574a6dc4ac476011a04c /include/core/SkScalerContext.h | |
parent | 649a8621866f64c6014c3c02d502a47440d859bf (diff) |
check-point for kLCD16_Format mask support
disabled for now in SkPaint.cpp (for further testing)
git-svn-id: http://skia.googlecode.com/svn/trunk@917 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core/SkScalerContext.h')
-rw-r--r-- | include/core/SkScalerContext.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/include/core/SkScalerContext.h b/include/core/SkScalerContext.h index 317658dbd1..584b86bfb6 100644 --- a/include/core/SkScalerContext.h +++ b/include/core/SkScalerContext.h @@ -53,18 +53,27 @@ struct SkGlyph { fMaskFormat = MASK_FORMAT_UNKNOWN; } - unsigned rowBytes() const { - unsigned rb = fWidth; - if (SkMask::kBW_Format == fMaskFormat) { + /** + * Compute the rowbytes for the specified width and mask-format. + */ + static unsigned ComputeRowBytes(unsigned width, SkMask::Format format) { + unsigned rb = width; + if (SkMask::kBW_Format == format) { rb = (rb + 7) >> 3; - } else if (SkMask::kARGB32_Format == fMaskFormat) { + } else if (SkMask::kARGB32_Format == format) { rb <<= 2; + } else if (SkMask::kLCD16_Format == format) { + rb = SkAlign4(rb << 1); } else { rb = SkAlign4(rb); } return rb; } + unsigned rowBytes() const { + return ComputeRowBytes(fWidth, (SkMask::Format)fMaskFormat); + } + bool isJustAdvance() const { return MASK_FORMAT_JUST_ADVANCE == fMaskFormat; } |