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

Unified Diff: src/core/SkGlyphCache.cpp

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 | « no previous file | src/core/SkGlyphCache_Globals.h » ('j') | src/core/SkGlyphCache_Globals.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkGlyphCache.cpp
diff --git a/src/core/SkGlyphCache.cpp b/src/core/SkGlyphCache.cpp
index 30d00b2463aa6398e142a7eb895262ceaa28191e..6d978a6b5fd2d53302b9724693e9b48868c6b7c8 100644
--- a/src/core/SkGlyphCache.cpp
+++ b/src/core/SkGlyphCache.cpp
@@ -470,6 +470,21 @@ void SkGlyphCache::invokeAndRemoveAuxProcs() {
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
+size_t SkGlyphCache_Globals::getTotalMemoryUsed() const {
+ SkAutoExclusive ac(fLock);
+ return fTotalMemoryUsed;
+}
+
+int SkGlyphCache_Globals::getCacheCountUsed() const {
+ SkAutoExclusive ac(fLock);
+ return fCacheCount;
+}
+
+int SkGlyphCache_Globals::getCacheCountLimit() const {
+ SkAutoExclusive ac(fLock);
+ return fCacheCountLimit;
+}
+
size_t SkGlyphCache_Globals::setCacheSizeLimit(size_t newLimit) {
static const size_t minLimit = 256 * 1024;
if (newLimit < minLimit) {
@@ -484,6 +499,11 @@ size_t SkGlyphCache_Globals::setCacheSizeLimit(size_t newLimit) {
return prevLimit;
}
+size_t SkGlyphCache_Globals::getCacheSizeLimit() const {
+ SkAutoExclusive ac(fLock);
+ return fCacheSizeLimit;
+}
+
int SkGlyphCache_Globals::setCacheCountLimit(int newCount) {
if (newCount < 0) {
newCount = 0;
« no previous file with comments | « no previous file | src/core/SkGlyphCache_Globals.h » ('j') | src/core/SkGlyphCache_Globals.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698