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

Unified Diff: trunk/src/core/SkGlyphCache.cpp

Issue 12706010: Add SkTypeface* parameter to SkScalerContext (and its callers) (Closed) Base URL: http://skia.googlecode.com/svn/
Patch Set: Created 7 years, 9 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
Index: trunk/src/core/SkGlyphCache.cpp
===================================================================
--- trunk/src/core/SkGlyphCache.cpp (revision 8166)
+++ trunk/src/core/SkGlyphCache.cpp (working copy)
@@ -52,12 +52,12 @@
#define METRICS_RESERVE_COUNT 128 // so we don't grow this array a lot
-SkGlyphCache::SkGlyphCache(const SkDescriptor* desc)
+SkGlyphCache::SkGlyphCache(SkTypeface* typeface, const SkDescriptor* desc)
: fGlyphAlloc(kMinGlphAlloc), fImageAlloc(kMinImageAlloc) {
fPrev = fNext = NULL;
fDesc = desc->copy();
- fScalerContext = SkScalerContext::Create(desc);
+ fScalerContext = typeface->createScalerContext(desc);
fScalerContext->getFontMetrics(NULL, &fFontMetricsY);
// init to 0 so that all of the pointers will be null
@@ -523,7 +523,8 @@
- try to acquire the mutext again
- call a fontscaler (which might call into the cache)
*/
-SkGlyphCache* SkGlyphCache::VisitCache(const SkDescriptor* desc,
+SkGlyphCache* SkGlyphCache::VisitCache(SkTypeface* typeface,
+ const SkDescriptor* desc,
bool (*proc)(const SkGlyphCache*, void*),
void* context) {
SkASSERT(desc);
@@ -558,7 +559,7 @@
ac.release(); // release the mutex now
insideMutex = false; // can't use globals anymore
- cache = SkNEW_ARGS(SkGlyphCache, (desc));
+ cache = SkNEW_ARGS(SkGlyphCache, (typeface, desc));
FOUND_IT:

Powered by Google App Engine
This is Rietveld 408576698