aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrResourceAllocator.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/GrResourceAllocator.h')
-rw-r--r--src/gpu/GrResourceAllocator.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/gpu/GrResourceAllocator.h b/src/gpu/GrResourceAllocator.h
index f383ee4653..fc3d031165 100644
--- a/src/gpu/GrResourceAllocator.h
+++ b/src/gpu/GrResourceAllocator.h
@@ -22,6 +22,9 @@ class GrUninstantiateProxyTracker;
// Print out explicit allocation information
#define GR_ALLOCATION_SPEW 0
+// Print out information about interval creation
+#define GR_TRACK_INTERVAL_CREATION 0
+
/*
* The ResourceAllocator explicitly distributes GPU resources at flush time. It operates by
* being given the usage intervals of the various proxies. It keeps these intervals in a singly
@@ -112,6 +115,11 @@ private:
, fEnd(end)
, fNext(nullptr) {
SkASSERT(proxy);
+#if GR_TRACK_INTERVAL_CREATION
+ fUniqueID = CreateUniqueID();
+ SkDebugf("New intvl %d: proxyID: %d [ %d, %d ]\n",
+ fUniqueID, proxy->uniqueID().asUInt(), start, end);
+#endif
}
void resetTo(GrSurfaceProxy* proxy, unsigned int start, unsigned int end) {
@@ -122,6 +130,11 @@ private:
fStart = start;
fEnd = end;
fNext = nullptr;
+#if GR_TRACK_INTERVAL_CREATION
+ fUniqueID = CreateUniqueID();
+ SkDebugf("New intvl %d: proxyID: %d [ %d, %d ]\n",
+ fUniqueID, proxy->uniqueID().asUInt(), start, end);
+#endif
}
~Interval() {
@@ -140,6 +153,9 @@ private:
void extendEnd(unsigned int newEnd) {
if (newEnd > fEnd) {
fEnd = newEnd;
+#if GR_TRACK_INTERVAL_CREATION
+ SkDebugf("intvl %d: extending from %d to %d\n", fUniqueID, fEnd, newEnd);
+#endif
}
}
@@ -160,6 +176,12 @@ private:
unsigned int fStart;
unsigned int fEnd;
Interval* fNext;
+
+#if GR_TRACK_INTERVAL_CREATION
+ uint32_t fUniqueID;
+
+ uint32_t CreateUniqueID();
+#endif
};
class IntervalList {