aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkGlyphCache.cpp
diff options
context:
space:
mode:
authorGravatar herb <herb@google.com>2016-06-22 10:19:16 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-06-22 10:19:16 -0700
commit632d004677de66a985d05c25a25e25272c740ede (patch)
treeed2ef0aeabf4529faebdb551a8168cff77d0f253 /src/core/SkGlyphCache.cpp
parent3917cf4ef76dabecd340f1e4cd7999802809e5ca (diff)
Add guards around access to font cache global fields.
Diffstat (limited to 'src/core/SkGlyphCache.cpp')
-rw-r--r--src/core/SkGlyphCache.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/core/SkGlyphCache.cpp b/src/core/SkGlyphCache.cpp
index 30d00b2463..6d978a6b5f 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;