Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: src/gpu/GrResourceCache.cpp

Issue 1313743002: Add onMemoryDump to GrContext (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Review feedback Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/GrResourceCache.cpp
diff --git a/src/gpu/GrResourceCache.cpp b/src/gpu/GrResourceCache.cpp
index e77d9acd62ff37f0fd0eb1b05b1250da3d35a920..c6c2eee0d0bed3ba1269609a26d16c317c523306 100644
--- a/src/gpu/GrResourceCache.cpp
+++ b/src/gpu/GrResourceCache.cpp
@@ -564,7 +564,7 @@ uint32_t GrResourceCache::getNextTimestamp() {
int currP = 0;
int currNP = 0;
while (currP < sortedPurgeableResources.count() &&
- currNP < fNonpurgeableResources.count()) {
+ currNP < fNonpurgeableResources.count()) {
uint32_t tsP = sortedPurgeableResources[currP]->cacheAccess().timestamp();
uint32_t tsNP = fNonpurgeableResources[currNP]->cacheAccess().timestamp();
SkASSERT(tsP != tsNP);
@@ -596,10 +596,10 @@ uint32_t GrResourceCache::getNextTimestamp() {
// count should be the next timestamp we return.
SkASSERT(fTimestamp == SkToU32(count));
-
+
// The historical timestamps of flushes are now invalid.
this->resetFlushTimestamps();
- }
+ }
}
return fTimestamp++;
}
@@ -616,6 +616,15 @@ void GrResourceCache::notifyFlushOccurred() {
}
}
+void GrResourceCache::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const {
+ for (int i = 0; i < fNonpurgeableResources.count(); ++i) {
+ fNonpurgeableResources[i]->dumpMemoryStatistics(traceMemoryDump);
+ }
+ for (int i = 0; i < fPurgeableQueue.count(); ++i) {
+ fPurgeableQueue.at(i)->dumpMemoryStatistics(traceMemoryDump);
+ }
+}
+
#ifdef SK_DEBUG
void GrResourceCache::validate() const {
// Reduce the frequency of validations for large resource counts.

Powered by Google App Engine
This is Rietveld 408576698