From 427c2819d9237d7d7729c59238036cfc73c072ea Mon Sep 17 00:00:00 2001 From: mtklein Date: Wed, 4 May 2016 11:31:29 -0700 Subject: Modernize SkMutex and SkSemaphore. - use - fuse SkMutex and SkBaseMutex - fuse SkSemaphore and SkBaseSemaphore Still TODO: - replace SK_DECLARE_STATIC_MUTEX(name) with static SkMutex name I just didn't want to bother fixing all that up until I know this CL sticks. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1947153002 No public API changes. TBR=reed@google.com Review-Url: https://codereview.chromium.org/1947153002 --- src/lazy/SkDiscardableMemoryPool.cpp | 13 ++++++------- src/lazy/SkDiscardableMemoryPool.h | 3 +-- 2 files changed, 7 insertions(+), 9 deletions(-) (limited to 'src/lazy') diff --git a/src/lazy/SkDiscardableMemoryPool.cpp b/src/lazy/SkDiscardableMemoryPool.cpp index 1f3bcf93e9..2be4c755f1 100644 --- a/src/lazy/SkDiscardableMemoryPool.cpp +++ b/src/lazy/SkDiscardableMemoryPool.cpp @@ -29,7 +29,7 @@ public: /** * Without mutex, will be not be thread safe. */ - DiscardableMemoryPool(size_t budget, SkBaseMutex* mutex = nullptr); + DiscardableMemoryPool(size_t budget, SkMutex* mutex = nullptr); virtual ~DiscardableMemoryPool(); SkDiscardableMemory* create(size_t bytes) override; @@ -52,9 +52,9 @@ public: #endif // SK_LAZY_CACHE_STATS private: - SkBaseMutex* fMutex; - size_t fBudget; - size_t fUsed; + SkMutex* fMutex; + size_t fBudget; + size_t fUsed; SkTInternalLList fList; /** Function called to free memory if needed */ @@ -128,8 +128,7 @@ void PoolDiscardableMemory::unlock() { //////////////////////////////////////////////////////////////////////////////// -DiscardableMemoryPool::DiscardableMemoryPool(size_t budget, - SkBaseMutex* mutex) +DiscardableMemoryPool::DiscardableMemoryPool(size_t budget, SkMutex* mutex) : fMutex(mutex) , fBudget(budget) , fUsed(0) { @@ -241,7 +240,7 @@ void DiscardableMemoryPool::dumpPool() { } // namespace -SkDiscardableMemoryPool* SkDiscardableMemoryPool::Create(size_t size, SkBaseMutex* mutex) { +SkDiscardableMemoryPool* SkDiscardableMemoryPool::Create(size_t size, SkMutex* mutex) { return new DiscardableMemoryPool(size, mutex); } diff --git a/src/lazy/SkDiscardableMemoryPool.h b/src/lazy/SkDiscardableMemoryPool.h index 92ba48bcb4..ad8d796f66 100644 --- a/src/lazy/SkDiscardableMemoryPool.h +++ b/src/lazy/SkDiscardableMemoryPool.h @@ -52,8 +52,7 @@ public: * the pool works. * Without mutex, will be not be thread safe. */ - static SkDiscardableMemoryPool* Create( - size_t size, SkBaseMutex* mutex = nullptr); + static SkDiscardableMemoryPool* Create(size_t size, SkMutex* mutex = nullptr); }; /** -- cgit v1.2.3