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

Side by Side Diff: core/SkPaint.cpp

Issue 148453005: Calculate Underline thickness for Skia from Font metrics (Closed) Base URL: https://chromium.googlesource.com/external/skia/src.git@master
Patch Set: Created 6 years, 10 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 | « no previous file | ports/SkFontHost_FreeType.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 /* 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 "SkPaint.h" 9 #include "SkPaint.h"
10 #include "SkAnnotation.h" 10 #include "SkAnnotation.h"
(...skipping 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 if (scale) { 1289 if (scale) {
1290 metrics->fTop = SkScalarMul(metrics->fTop, scale); 1290 metrics->fTop = SkScalarMul(metrics->fTop, scale);
1291 metrics->fAscent = SkScalarMul(metrics->fAscent, scale); 1291 metrics->fAscent = SkScalarMul(metrics->fAscent, scale);
1292 metrics->fDescent = SkScalarMul(metrics->fDescent, scale); 1292 metrics->fDescent = SkScalarMul(metrics->fDescent, scale);
1293 metrics->fBottom = SkScalarMul(metrics->fBottom, scale); 1293 metrics->fBottom = SkScalarMul(metrics->fBottom, scale);
1294 metrics->fLeading = SkScalarMul(metrics->fLeading, scale); 1294 metrics->fLeading = SkScalarMul(metrics->fLeading, scale);
1295 metrics->fAvgCharWidth = SkScalarMul(metrics->fAvgCharWidth, scale); 1295 metrics->fAvgCharWidth = SkScalarMul(metrics->fAvgCharWidth, scale);
1296 metrics->fXMin = SkScalarMul(metrics->fXMin, scale); 1296 metrics->fXMin = SkScalarMul(metrics->fXMin, scale);
1297 metrics->fXMax = SkScalarMul(metrics->fXMax, scale); 1297 metrics->fXMax = SkScalarMul(metrics->fXMax, scale);
1298 metrics->fXHeight = SkScalarMul(metrics->fXHeight, scale); 1298 metrics->fXHeight = SkScalarMul(metrics->fXHeight, scale);
1299 metrics->fUnderlineThickness = SkScalarMul(metrics->fUnderlineThickness, scale);
1299 } 1300 }
1300 return metrics->fDescent - metrics->fAscent + metrics->fLeading; 1301 return metrics->fDescent - metrics->fAscent + metrics->fLeading;
1301 } 1302 }
1302 1303
1303 /////////////////////////////////////////////////////////////////////////////// 1304 ///////////////////////////////////////////////////////////////////////////////
1304 1305
1305 static void set_bounds(const SkGlyph& g, SkRect* bounds, SkScalar scale) { 1306 static void set_bounds(const SkGlyph& g, SkRect* bounds, SkScalar scale) {
1306 bounds->set(g.fLeft * scale, 1307 bounds->set(g.fLeft * scale,
1307 g.fTop * scale, 1308 g.fTop * scale,
1308 (g.fLeft + g.fWidth) * scale, 1309 (g.fLeft + g.fWidth) * scale,
(...skipping 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after
2577 case SkXfermode::kPlus_Mode: 2578 case SkXfermode::kPlus_Mode:
2578 return 0 == this->getAlpha(); 2579 return 0 == this->getAlpha();
2579 case SkXfermode::kDst_Mode: 2580 case SkXfermode::kDst_Mode:
2580 return true; 2581 return true;
2581 default: 2582 default:
2582 break; 2583 break;
2583 } 2584 }
2584 } 2585 }
2585 return false; 2586 return false;
2586 } 2587 }
OLDNEW
« no previous file with comments | « no previous file | ports/SkFontHost_FreeType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698