8#ifndef GrGpuResourceCacheAccess_DEFINED
9#define GrGpuResourceCacheAccess_DEFINED
30 bool isScratch()
const {
35 bool isUsableAsScratch()
const {
44 if (!fResource->hasRef() && fResource->hasNoCommandBufferUsages()) {
54 if (!fResource->hasRef() && fResource->hasNoCommandBufferUsages()) {
63 bool hasRef()
const {
return fResource->hasRef(); }
64 bool hasRefOrCommandBufferUsage()
const {
65 return this->hasRef() || !fResource->hasNoCommandBufferUsages();
69 void removeUniqueKey() { fResource->fUniqueKey.
reset(); }
71 uint32_t timestamp()
const {
return fResource->fTimestamp; }
72 void setTimestamp(uint32_t ts) { fResource->fTimestamp = ts; }
74 void setTimeWhenResourceBecomePurgeable() {
76 fResource->fTimeWhenBecamePurgeable = skgpu::StdSteadyClock::now();
82 skgpu::StdSteadyClock::time_point timeWhenResourceBecamePurgeable() {
84 return fResource->fTimeWhenBecamePurgeable;
87 int* accessCacheIndex()
const {
return &fResource->fCacheArrayIndex; }
static SkString resource(SkPDFResourceType type, int index)
friend void test_unbudgeted_to_scratch(skiatest::Reporter *reporter)
GrBudgetedType budgetedType() const
const skgpu::UniqueKey & getUniqueKey() const
CacheAccess cacheAccess()
ResourcePriv resourcePriv()
void addInitialRef() const
bool internalHasRef() const