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

Unified Diff: src/core/SkPaint.cpp

Issue 14940018: we only need one fontmetrics, since the paint (and fontcache) now know explicitly (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkGlyphCache.cpp ('k') | src/core/SkScalerContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPaint.cpp
===================================================================
--- src/core/SkPaint.cpp (revision 9053)
+++ src/core/SkPaint.cpp (working copy)
@@ -1203,7 +1203,7 @@
///////////////////////////////////////////////////////////////////////////////
static bool FontMetricsCacheProc(const SkGlyphCache* cache, void* context) {
- *(SkPaint::FontMetrics*)context = cache->getFontMetricsY();
+ *(SkPaint::FontMetrics*)context = cache->getFontMetrics();
return false; // don't detach the cache
}
@@ -1228,11 +1228,6 @@
zoomPtr = &zoomMatrix;
}
-#if 0
- SkAutoGlyphCache autoCache(*this, zoomPtr);
- SkGlyphCache* cache = autoCache.getCache();
- const FontMetrics& my = cache->getFontMetricsY();
-#endif
FontMetrics storage;
if (NULL == metrics) {
metrics = &storage;
@@ -1246,6 +1241,10 @@
metrics->fDescent = SkScalarMul(metrics->fDescent, scale);
metrics->fBottom = SkScalarMul(metrics->fBottom, scale);
metrics->fLeading = SkScalarMul(metrics->fLeading, scale);
+ metrics->fAvgCharWidth = SkScalarMul(metrics->fAvgCharWidth, scale);
+ metrics->fXMin = SkScalarMul(metrics->fXMin, scale);
+ metrics->fXMax = SkScalarMul(metrics->fXMax, scale);
+ metrics->fXHeight = SkScalarMul(metrics->fXHeight, scale);
}
return metrics->fDescent - metrics->fAscent + metrics->fLeading;
}
« no previous file with comments | « src/core/SkGlyphCache.cpp ('k') | src/core/SkScalerContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698