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

Side by Side Diff: src/ports/SkFontHost_FreeType.cpp

Issue 1135053002: stop calling SkScalarDiv (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix xpsdevice Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « src/pdf/SkPDFShader.cpp ('k') | src/svg/parser/SkSVGSVG.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkAdvancedTypefaceMetrics.h" 8 #include "SkAdvancedTypefaceMetrics.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after
1191 glyph->fRsbDelta = SkToS8(fFace->glyph->rsb_delta); 1191 glyph->fRsbDelta = SkToS8(fFace->glyph->rsb_delta);
1192 glyph->fLsbDelta = SkToS8(fFace->glyph->lsb_delta); 1192 glyph->fLsbDelta = SkToS8(fFace->glyph->lsb_delta);
1193 } 1193 }
1194 } 1194 }
1195 } 1195 }
1196 1196
1197 // If the font isn't scalable, scale the metrics from the non-scalable strik e. 1197 // If the font isn't scalable, scale the metrics from the non-scalable strik e.
1198 // This means do not try to scale embedded bitmaps; only scale bitmaps in bi tmap only fonts. 1198 // This means do not try to scale embedded bitmaps; only scale bitmaps in bi tmap only fonts.
1199 if (!FT_IS_SCALABLE(fFace) && fScaleY && fFace->size->metrics.y_ppem) { 1199 if (!FT_IS_SCALABLE(fFace) && fScaleY && fFace->size->metrics.y_ppem) {
1200 // NOTE: both dimensions are scaled by y_ppem. this is WAI. 1200 // NOTE: both dimensions are scaled by y_ppem. this is WAI.
1201 scaleGlyphMetrics(*glyph, SkScalarDiv(SkFixedToScalar(fScaleY), 1201 scaleGlyphMetrics(*glyph, SkFixedToScalar(fScaleY) / fFace->size->metric s.y_ppem);
1202 SkIntToScalar(fFace->size->metrics .y_ppem)));
1203 } 1202 }
1204 1203
1205 #ifdef ENABLE_GLYPH_SPEW 1204 #ifdef ENABLE_GLYPH_SPEW
1206 SkDEBUGF(("FT_Set_Char_Size(this:%p sx:%x sy:%x ", this, fScaleX, fScaleY)); 1205 SkDEBUGF(("FT_Set_Char_Size(this:%p sx:%x sy:%x ", this, fScaleX, fScaleY));
1207 SkDEBUGF(("Metrics(glyph:%d flags:0x%x) w:%d\n", glyph->getGlyphID(), fLoadG lyphFlags, glyph->fWidth)); 1206 SkDEBUGF(("Metrics(glyph:%d flags:0x%x) w:%d\n", glyph->getGlyphID(), fLoadG lyphFlags, glyph->fWidth));
1208 #endif 1207 #endif
1209 } 1208 }
1210 1209
1211 static void clear_glyph_image(const SkGlyph& glyph) { 1210 static void clear_glyph_image(const SkGlyph& glyph) {
1212 sk_bzero(glyph.fImage, glyph.rowBytes() * glyph.fHeight); 1211 sk_bzero(glyph.fImage, glyph.rowBytes() * glyph.fHeight);
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
1722 if (style) { 1721 if (style) {
1723 *style = SkFontStyle(weight, width, slant); 1722 *style = SkFontStyle(weight, width, slant);
1724 } 1723 }
1725 if (isFixedPitch) { 1724 if (isFixedPitch) {
1726 *isFixedPitch = FT_IS_FIXED_WIDTH(face); 1725 *isFixedPitch = FT_IS_FIXED_WIDTH(face);
1727 } 1726 }
1728 1727
1729 FT_Done_Face(face); 1728 FT_Done_Face(face);
1730 return true; 1729 return true;
1731 } 1730 }
OLDNEW
« no previous file with comments | « src/pdf/SkPDFShader.cpp ('k') | src/svg/parser/SkSVGSVG.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698