summaryrefslogtreecommitdiffstats
path: root/skia/ports
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-22 21:44:53 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-22 21:44:53 +0000
commitde5009e4428544ac527de487157c63b64788d459 (patch)
treeb45b51865cd8f83185ab04bfc73bb100bcd2b6c9 /skia/ports
parent4fc992441642df30b7bdb8c5193d586c5baea798 (diff)
downloadchromium_src-de5009e4428544ac527de487157c63b64788d459.zip
chromium_src-de5009e4428544ac527de487157c63b64788d459.tar.gz
chromium_src-de5009e4428544ac527de487157c63b64788d459.tar.bz2
Skia: Apply upstream patch:
Applying this patch locally to check that it doesn't break any layout tests etc: http://codereview.appspot.com/41081 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14250 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ports')
-rw-r--r--skia/ports/SkFontHost_FreeType.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/skia/ports/SkFontHost_FreeType.cpp b/skia/ports/SkFontHost_FreeType.cpp
index a356da7..86efee1 100644
--- a/skia/ports/SkFontHost_FreeType.cpp
+++ b/skia/ports/SkFontHost_FreeType.cpp
@@ -759,8 +759,8 @@ void SkScalerContext_FreeType::generateFontMetrics(SkPaint::FontMetrics* mx,
SkFixed scaleY = fScaleY;
SkFixed mxy = fMatrix22.xy;
SkFixed myy = fMatrix22.yy;
- SkScalar xmin = static_cast<SkScalar>(face->bbox.xMin) / upem;
- SkScalar xmax = static_cast<SkScalar>(face->bbox.xMax) / upem;
+ SkScalar xmin = SkIntToScalar(face->bbox.xMin) / upem;
+ SkScalar xmax = SkIntToScalar(face->bbox.xMax) / upem;
int leading = face->height - (face->ascender + -face->descender);
if (leading < 0) {
@@ -780,15 +780,14 @@ void SkScalerContext_FreeType::generateFontMetrics(SkPaint::FontMetrics* mx,
SkScalar x_height;
if (os2 && os2->sxHeight) {
- x_height = (static_cast<SkScalar>(os2->sxHeight) / upem) *
- (static_cast<SkScalar>(fScaleX) / 65536);
+ x_height = SkFixedToScalar(SkMulDiv(fScaleX, os2->sxHeight, upem));
} else {
const FT_UInt x_glyph = FT_Get_Char_Index(fFace, 'x');
if (x_glyph) {
FT_BBox bbox;
FT_Load_Glyph(fFace, x_glyph, fLoadGlyphFlags);
FT_Outline_Get_CBox(&fFace->glyph->outline, &bbox);
- x_height = static_cast<SkScalar>(bbox.yMax) / 64;
+ x_height = SkIntToScalar(bbox.yMax) / 64;
} else {
x_height = 0;
}