Some fonts do not measure correctly in Mountain Lion,

carrying over a bug from Lion. Add the check
appropriately.
Review URL: https://codereview.appspot.com/6026045

git-svn-id: http://skia.googlecode.com/svn/trunk@3675 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
caryclark@google.com 2012-04-13 16:05:44 +00:00
parent 5e508b9156
commit 32a0fb051f

View File

@ -219,6 +219,10 @@ static bool isLion() {
return darwinVersion() == 11; return darwinVersion() == 11;
} }
static bool isMountainLion() {
return darwinVersion() == 12;
}
static bool isLCDFormat(unsigned format) { static bool isLCDFormat(unsigned format) {
return SkMask::kLCD16_Format == format || SkMask::kLCD32_Format == format; return SkMask::kLCD16_Format == format || SkMask::kLCD32_Format == format;
} }
@ -1024,7 +1028,7 @@ void SkScalerContext_Mac::generateMetrics(SkGlyph* glyph) {
// Get the metrics // Get the metrics
bool lionAdjustedMetrics = false; bool lionAdjustedMetrics = false;
if (isLion()) { if (isLion() || isMountainLion()) {
if (cgGlyph < fGlyphCount && cgGlyph >= getAdjustStart() if (cgGlyph < fGlyphCount && cgGlyph >= getAdjustStart()
&& generateBBoxes()) { && generateBBoxes()) {
lionAdjustedMetrics = true; lionAdjustedMetrics = true;