#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "cc/paint/paint_cache.h"
#include "base/check_op.h"
#include "base/containers/flat_set.h"
#include "base/not_fatal_until.h"
#include "base/notreached.h"
#include "base/synchronization/lock.h"
namespace cc {
namespace {
template <typename T>
void EraseFromMap(T* map, size_t n, const volatile PaintCacheId* ids) { … }
}
constexpr size_t ClientPaintCache::kNoCachingBudget;
ClientPaintCache::ClientPaintCache(size_t max_budget_bytes)
: … { … }
ClientPaintCache::~ClientPaintCache() = default;
bool ClientPaintCache::Get(PaintCacheDataType type, PaintCacheId id) { … }
void ClientPaintCache::Put(PaintCacheDataType type,
PaintCacheId id,
size_t size) { … }
template <typename Iterator>
void ClientPaintCache::EraseFromMap(Iterator it) { … }
void ClientPaintCache::FinalizePendingEntries() { … }
void ClientPaintCache::AbortPendingEntries() { … }
void ClientPaintCache::Purge(PurgedData* purged_data) { … }
bool ClientPaintCache::PurgeAll() { … }
ServicePaintCache::ServicePaintCache() = default;
ServicePaintCache::~ServicePaintCache() = default;
void ServicePaintCache::PutPath(PaintCacheId id, SkPath path) { … }
bool ServicePaintCache::GetPath(PaintCacheId id, SkPath* path) const { … }
void ServicePaintCache::Purge(PaintCacheDataType type,
size_t n,
const volatile PaintCacheId* ids) { … }
void ServicePaintCache::PurgeAll() { … }
}