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

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

Issue 720743003: Remove SK_USE_SCALED_FONTMETRICS. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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 | « no previous file | no next file » | 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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkAdvancedTypefaceMetrics.h" 9 #include "SkAdvancedTypefaceMetrics.h"
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 1477 matching lines...) Expand 10 before | Expand all | Expand 10 after
1488 SkScalar scale = myy; 1488 SkScalar scale = myy;
1489 if (this->isVertical()) { 1489 if (this->isVertical()) {
1490 scale = mxy; 1490 scale = mxy;
1491 } 1491 }
1492 metrics->fTop = ymax * scale; 1492 metrics->fTop = ymax * scale;
1493 metrics->fAscent = ascent * scale; 1493 metrics->fAscent = ascent * scale;
1494 metrics->fDescent = descent * scale; 1494 metrics->fDescent = descent * scale;
1495 metrics->fBottom = ymin * scale; 1495 metrics->fBottom = ymin * scale;
1496 metrics->fLeading = leading * scale; 1496 metrics->fLeading = leading * scale;
1497 metrics->fAvgCharWidth = avgCharWidth * scale; 1497 metrics->fAvgCharWidth = avgCharWidth * scale;
1498 #ifdef SK_USE_SCALED_FONTMETRICS
1499 // new correct behavior. need chrome to define this, and then we can remove the else code
1500 metrics->fXMin = xmin * scale; 1498 metrics->fXMin = xmin * scale;
1501 metrics->fXMax = xmax * scale; 1499 metrics->fXMax = xmax * scale;
1502 #else
1503 metrics->fXMin = xmin;
1504 metrics->fXMax = xmax;
1505 #endif
1506 metrics->fXHeight = x_height; 1500 metrics->fXHeight = x_height;
1507 metrics->fCapHeight = cap_height; 1501 metrics->fCapHeight = cap_height;
1508 metrics->fUnderlineThickness = underlineThickness * scale; 1502 metrics->fUnderlineThickness = underlineThickness * scale;
1509 metrics->fUnderlinePosition = underlinePosition * scale; 1503 metrics->fUnderlinePosition = underlinePosition * scale;
1510 } 1504 }
1511 1505
1512 void SkScalerContext_FreeType::emboldenIfNeeded(FT_Face face, FT_GlyphSlot glyph ) 1506 void SkScalerContext_FreeType::emboldenIfNeeded(FT_Face face, FT_GlyphSlot glyph )
1513 { 1507 {
1514 // check to see if the embolden bit is set 1508 // check to see if the embolden bit is set
1515 if (0 == (fRec.fFlags & SkScalerContext::kEmbolden_Flag)) { 1509 if (0 == (fRec.fFlags & SkScalerContext::kEmbolden_Flag)) {
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
1807 if (style) { 1801 if (style) {
1808 *style = SkFontStyle(weight, width, slant); 1802 *style = SkFontStyle(weight, width, slant);
1809 } 1803 }
1810 if (isFixedPitch) { 1804 if (isFixedPitch) {
1811 *isFixedPitch = FT_IS_FIXED_WIDTH(face); 1805 *isFixedPitch = FT_IS_FIXED_WIDTH(face);
1812 } 1806 }
1813 1807
1814 FT_Done_Face(face); 1808 FT_Done_Face(face);
1815 return true; 1809 return true;
1816 } 1810 }
OLDNEW
« 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