81 : fDContext(dContext) {}
85 unsigned int curOp()
const {
return fNumOps; }
132#if GR_ALLOCATION_SPEW
133 void dumpIntervals();
141 void expire(
unsigned int curIndex);
144 void recycleRegister(Register* r);
147 struct FreePoolTraits {
149 return r.scratchKey();
153 static void OnFree(Register* r) { }
159 struct UniqueKeyHash {
163 UniqueKeyRegisterHash;
175 const skgpu::UniqueKey& uniqueKey()
const {
return fOriginatingProxy->getUniqueKey(); }
177 bool accountedForInBudget()
const {
return fAccountedForInBudget; }
178 void setAccountedForInBudget() { fAccountedForInBudget =
true; }
180 GrSurface* existingSurface()
const {
return fExistingSurface.get(); }
191 SkDEBUGCODE(uint32_t uniqueID()
const {
return fUniqueID; })
197 bool fAccountedForInBudget =
false;
202 static uint32_t CreateUniqueID();
214#if GR_TRACK_INTERVAL_CREATION
216 SkDebugf(
"New intvl %d: %s [%d, %d]\n", fUniqueID, proxyStr.
c_str(), start, end);
223 unsigned int start()
const {
return fStart; }
224 unsigned int end()
const {
return fEnd; }
230 Register* getRegister()
const {
return fRegister; }
231 void setRegister(Register* r) { fRegister = r; }
233 void addUse() { fUses++; }
234 int uses()
const {
return fUses; }
236 void extendEnd(
unsigned int newEnd) {
239#if GR_TRACK_INTERVAL_CREATION
240 SkDebugf(
"intvl %d: extending from %d to %d\n", fUniqueID, fEnd, newEnd);
245 void disallowRecycling() {
250 SkDEBUGCODE(uint32_t uniqueID()
const {
return fUniqueID; })
257 unsigned int fUses = 0;
264 static uint32_t CreateUniqueID();
270 IntervalList() =
default;
277 const Interval* peekHead()
const {
return fHead; }
278 Interval* peekHead() {
return fHead; }
280 void insertByIncreasingStart(
Interval*);
281 void insertByIncreasingEnd(
Interval*);
291 static const int kInitialArenaSize = 128 *
sizeof(
Interval);
294 FreePoolMultiMap fFreePool;
295 IntvlHash fIntvlHash;
297 IntervalList fIntvlList;
298 IntervalList fActiveIntvls;
300 IntervalList fFinishedIntvls;
302 UniqueKeyRegisterHash fUniqueKeyRegisters;
303 unsigned int fNumOps = 0;
309 bool fFailedInstantiation =
false;