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

Unified Diff: src/core/SkGlyphCache.cpp

Issue 2055023003: Type-erase SkAutoMutexAcquire and SkAutoExclusive. (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 | « include/private/SkMutex.h ('k') | src/ports/SkScalerContext_win_dw.cpp » ('j') | no next file with comments »
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 072541d14681e33f8b41726c9e9b2972ec3cf8da..30d00b2463aa6398e142a7eb895262ceaa28191e 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();
« no previous file with comments | « include/private/SkMutex.h ('k') | src/ports/SkScalerContext_win_dw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698