this->internalPurge(fTotalMemoryUsed);
}
-void SkGlyphCache::VisitAllCaches(bool (*proc)(SkGlyphCache*, void*),
- void* context) {
- SkGlyphCache_Globals& globals = getGlobals();
- SkAutoMutexAcquire ac(globals.fMutex);
- SkGlyphCache* cache;
-
- globals.validate();
-
- for (cache = globals.internalGetHead(); cache != NULL; cache = cache->fNext) {
- if (proc(cache, context)) {
- break;
- }
- }
-
- globals.validate();
-}
-
/* This guy calls the visitor from within the mutext lock, so the visitor
cannot:
- take too much time
SkScalerContext* getScalerContext() const { return fScalerContext; }
- /** Call proc on all cache entries, stopping early if proc returns true.
- The proc should not create or delete caches, since it could produce
- deadlock.
- */
- static void VisitAllCaches(bool (*proc)(SkGlyphCache*, void*), void* ctx);
-
/** Find a matching cache entry, and call proc() with it. If none is found
create a new one. If the proc() returns true, detach the cache and
return it, otherwise leave it and return NULL.