aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2016-06-10 13:56:35 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-06-10 13:56:35 -0700
commitf10637f2795b147751ef413237389d230b869360 (patch)
treec541e51ce4ced899de02eaff49f06aa82f125fda /src/core
parent8151103535bab8639dab2cb308b1b9c04651b632 (diff)
Type-erase SkAutoMutexAcquire and SkAutoExclusive.
This is purely for convenience, to not need to write the lock type in the guard anymore. This should all inline away. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2055023003 Review-Url: https://codereview.chromium.org/2055023003
Diffstat (limited to 'src/core')
-rw-r--r--src/core/SkGlyphCache.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/core/SkGlyphCache.cpp b/src/core/SkGlyphCache.cpp
index 072541d146..30d00b2463 100644
--- a/src/core/SkGlyphCache.cpp
+++ b/src/core/SkGlyphCache.cpp
@@ -470,15 +470,13 @@ void SkGlyphCache::invokeAndRemoveAuxProcs() {
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
-typedef SkAutoTExclusive<SkSpinlock> Exclusive;
-
size_t SkGlyphCache_Globals::setCacheSizeLimit(size_t newLimit) {
static const size_t minLimit = 256 * 1024;
if (newLimit < minLimit) {
newLimit = minLimit;
}
- Exclusive ac(fLock);
+ SkAutoExclusive ac(fLock);
size_t prevLimit = fCacheSizeLimit;
fCacheSizeLimit = newLimit;
@@ -491,7 +489,7 @@ int SkGlyphCache_Globals::setCacheCountLimit(int newCount) {
newCount = 0;
}
- Exclusive ac(fLock);
+ SkAutoExclusive ac(fLock);
int prevCount = fCacheCountLimit;
fCacheCountLimit = newCount;
@@ -500,7 +498,7 @@ int SkGlyphCache_Globals::setCacheCountLimit(int newCount) {
}
void SkGlyphCache_Globals::purgeAll() {
- Exclusive ac(fLock);
+ SkAutoExclusive ac(fLock);
this->internalPurge(fTotalMemoryUsed);
}
@@ -534,7 +532,7 @@ SkGlyphCache* SkGlyphCache::VisitCache(SkTypeface* typeface,
SkGlyphCache* cache;
{
- Exclusive ac(globals.fLock);
+ SkAutoExclusive ac(globals.fLock);
globals.validate();
@@ -647,7 +645,7 @@ void SkGlyphCache::DumpMemoryStatistics(SkTraceMemoryDump* dump) {
void SkGlyphCache::VisitAll(Visitor visitor, void* context) {
SkGlyphCache_Globals& globals = get_globals();
- Exclusive ac(globals.fLock);
+ SkAutoExclusive ac(globals.fLock);
SkGlyphCache* cache;
globals.validate();
@@ -660,7 +658,7 @@ void SkGlyphCache::VisitAll(Visitor visitor, void* context) {
///////////////////////////////////////////////////////////////////////////////
void SkGlyphCache_Globals::attachCacheToHead(SkGlyphCache* cache) {
- Exclusive ac(fLock);
+ SkAutoExclusive ac(fLock);
this->validate();
cache->validate();