aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPaint.cpp
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-19 14:44:54 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-19 14:44:54 +0000
commit90808e87c21e93b8e670360655e0b0eb12cb2f87 (patch)
tree0219fa6397867b6bfd18120d733dad498e1a338a /src/core/SkPaint.cpp
parent14687813ea0174dc165961ebca8df4153c3dde59 (diff)
Add SkTypeface* parameter to SkScalerContext (and its callers)
Use SkTypeface to create scalercontext instead of SkFontHost Review URL: https://codereview.chromium.org/12706010 git-svn-id: http://skia.googlecode.com/svn/trunk@8223 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkPaint.cpp')
-rw-r--r--src/core/SkPaint.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index c7ad933dd1..aa1b8e4803 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -414,8 +414,9 @@ SkAnnotation* SkPaint::setAnnotation(SkAnnotation* annotation) {
#include "SkGlyphCache.h"
#include "SkUtils.h"
-static void DetachDescProc(const SkDescriptor* desc, void* context) {
- *((SkGlyphCache**)context) = SkGlyphCache::DetachCache(desc);
+static void DetachDescProc(SkTypeface* typeface, const SkDescriptor* desc,
+ void* context) {
+ *((SkGlyphCache**)context) = SkGlyphCache::DetachCache(typeface, desc);
}
#ifdef SK_BUILD_FOR_ANDROID
@@ -1206,8 +1207,9 @@ static bool FontMetricsCacheProc(const SkGlyphCache* cache, void* context) {
return false; // don't detach the cache
}
-static void FontMetricsDescProc(const SkDescriptor* desc, void* context) {
- SkGlyphCache::VisitCache(desc, FontMetricsCacheProc, context);
+static void FontMetricsDescProc(SkTypeface* typeface, const SkDescriptor* desc,
+ void* context) {
+ SkGlyphCache::VisitCache(typeface, desc, FontMetricsCacheProc, context);
}
SkScalar SkPaint::getFontMetrics(FontMetrics* metrics, SkScalar zoom) const {
@@ -1761,7 +1763,7 @@ void SkScalerContext::PostMakeRec(const SkPaint&, SkScalerContext::Rec* rec) {
*/
void SkPaint::descriptorProc(const SkDeviceProperties* deviceProperties,
const SkMatrix* deviceMatrix,
- void (*proc)(const SkDescriptor*, void*),
+ void (*proc)(SkTypeface*, const SkDescriptor*, void*),
void* context, bool ignoreGamma) const {
SkScalerContext::Rec rec;
@@ -1873,7 +1875,7 @@ void SkPaint::descriptorProc(const SkDeviceProperties* deviceProperties,
}
#endif
- proc(desc, context);
+ proc(fTypeface, desc, context);
}
SkGlyphCache* SkPaint::detachCache(const SkDeviceProperties* deviceProperties,