diff options
author | reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2009-12-08 22:02:26 +0000 |
---|---|---|
committer | reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2009-12-08 22:02:26 +0000 |
commit | b757f8d20c582463999bd7aa5a48110e84945d19 (patch) | |
tree | 619bd354ea158520c775b2216c097e773a0a24cf | |
parent | cb60844b34766aad4151df5e87c144d4a57e9abe (diff) |
reinstate the empty check, and always initialize the format field
git-svn-id: http://skia.googlecode.com/svn/trunk@453 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | src/core/SkScalerContext.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/SkScalerContext.cpp b/src/core/SkScalerContext.cpp index 413f06c1f3..b9cd3aca4c 100644 --- a/src/core/SkScalerContext.cpp +++ b/src/core/SkScalerContext.cpp @@ -319,7 +319,7 @@ void SkScalerContext::getMetrics(SkGlyph* glyph) { SkIRect ir; devPath.getBounds().roundOut(&ir); - if (!ir.is16Bit()) { + if (ir.isEmpty() || !ir.is16Bit()) { goto SK_ERROR; } glyph->fLeft = ir.fLeft; @@ -356,6 +356,9 @@ SK_ERROR: glyph->fTop = 0; glyph->fWidth = 0; glyph->fHeight = 0; + // put a valid value here, in case it was earlier set to + // MASK_FORMAT_JUST_ADVANCE + glyph->fMaskFormat = fRec.fMaskFormat; } void SkScalerContext::getImage(const SkGlyph& origGlyph) { |