#include "include/private/base/SkMalloc.h"
#include "include/private/base/SkMutex.h"
#include "include/private/base/SkTemplates.h"
#include "include/private/chromium/SkDiscardableMemory.h"
#include "src/base/SkTInternalLList.h"
#include "src/lazy/SkDiscardableMemoryPool.h"
usingnamespaceskia_private;
namespace {
class PoolDiscardableMemory;
class DiscardableMemoryPool : public SkDiscardableMemoryPool { … };
class PoolDiscardableMemory : public SkDiscardableMemory { … };
PoolDiscardableMemory::PoolDiscardableMemory(sk_sp<DiscardableMemoryPool> pool,
UniqueVoidPtr pointer,
size_t bytes)
: … { … }
PoolDiscardableMemory::~PoolDiscardableMemory() { … }
bool PoolDiscardableMemory::lock() { … }
void* PoolDiscardableMemory::data() { … }
void PoolDiscardableMemory::unlock() { … }
DiscardableMemoryPool::DiscardableMemoryPool(size_t budget)
: … { … }
DiscardableMemoryPool::~DiscardableMemoryPool() { … }
void DiscardableMemoryPool::dumpDownTo(size_t budget) { … }
std::unique_ptr<SkDiscardableMemory> DiscardableMemoryPool::make(size_t bytes) { … }
void DiscardableMemoryPool::removeFromPool(PoolDiscardableMemory* dm) { … }
bool DiscardableMemoryPool::lock(PoolDiscardableMemory* dm) { … }
void DiscardableMemoryPool::unlock(PoolDiscardableMemory* dm) { … }
size_t DiscardableMemoryPool::getRAMUsed() { … }
void DiscardableMemoryPool::setRAMBudget(size_t budget) { … }
void DiscardableMemoryPool::dumpPool() { … }
}
sk_sp<SkDiscardableMemoryPool> SkDiscardableMemoryPool::Make(size_t size) { … }
SkDiscardableMemoryPool* SkGetGlobalDiscardableMemoryPool() { … }