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

Unified Diff: src/core/SkGlyphCache_Globals.h

Issue 2082423002: Add guards around access to font cache global fields. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 6 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') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkGlyphCache_Globals.h
diff --git a/src/core/SkGlyphCache_Globals.h b/src/core/SkGlyphCache_Globals.h
index e1825a2f0f90d935a8c5d90637c373d293b07d2b..4d7fe22d807dcd2dc8b12ce55acae983cd1ef522 100644
--- a/src/core/SkGlyphCache_Globals.h
+++ b/src/core/SkGlyphCache_Globals.h
@@ -42,13 +42,13 @@ public:
}
}
- SkSpinlock fLock;
+ mutable SkSpinlock fLock;
reed1 2016/06/22 16:05:36 make private?
SkGlyphCache* internalGetHead() const { return fHead; }
SkGlyphCache* internalGetTail() const;
- size_t getTotalMemoryUsed() const { return fTotalMemoryUsed; }
- int getCacheCountUsed() const { return fCacheCount; }
+ size_t getTotalMemoryUsed() const;
+ int getCacheCountUsed() const;
#ifdef SK_DEBUG
void validate() const;
@@ -56,19 +56,12 @@ public:
void validate() const {}
#endif
- int getCacheCountLimit() const { return fCacheCountLimit; }
+ int getCacheCountLimit() const;
int setCacheCountLimit(int limit);
- size_t getCacheSizeLimit() const { return fCacheSizeLimit; }
+ size_t getCacheSizeLimit() const;
size_t setCacheSizeLimit(size_t limit);
- // returns true if this cache is over-budget either due to size limit
- // or count limit.
- bool isOverBudget() const {
- return fCacheCount > fCacheCountLimit ||
- fTotalMemoryUsed > fCacheSizeLimit;
- }
-
void purgeAll(); // does not change budget
// call when a glyphcache is available for caching (i.e. not in use)
« no previous file with comments | « src/core/SkGlyphCache.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698