Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Unified Diff: src/ports/SkFontHost_FreeType.cpp

Issue 596513002: Don't try to scale embedded bitmaps. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontHost_FreeType.cpp
diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp
index 7ac2083930a0cd020b00da7f90d802e47ab9b9ce..aaf6d4f5a8cbf3492d349062c74771a94f3cbcb3 100644
--- a/src/ports/SkFontHost_FreeType.cpp
+++ b/src/ports/SkFontHost_FreeType.cpp
@@ -1301,7 +1301,10 @@ void SkScalerContext_FreeType::generateMetrics(SkGlyph* glyph) {
}
}
- if (fFace->glyph->format == FT_GLYPH_FORMAT_BITMAP && fScaleY && fFace->size->metrics.y_ppem) {
+ // Do not try to scale embedded bitmaps; only scale bitmaps in bitmap only fonts.
+ if (fFace->glyph->format == FT_GLYPH_FORMAT_BITMAP && !FT_IS_SCALABLE(fFace) &&
+ fScaleY && fFace->size->metrics.y_ppem)
mtklein 2014/09/22 18:50:42 First check is now obsolete?
bungeman-skia 2014/09/22 19:02:52 Indeed it is. It makes more sense to say !FT_IS_SC
+ {
// NOTE: both dimensions are scaled by y_ppem. this is WAI.
scaleGlyphMetrics(*glyph, SkScalarDiv(SkFixedToScalar(fScaleY),
SkIntToScalar(fFace->size->metrics.y_ppem)));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698