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

Unified Diff: src/gpu/GrResourceCache.cpp

Issue 977143002: skia: Add tracing for skia's budget (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: remove newline too Created 5 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrResourceCache.cpp
diff --git a/src/gpu/GrResourceCache.cpp b/src/gpu/GrResourceCache.cpp
index aed31b73d2af4ff3cacedd358d9497a3cd0fb7f6..8b445683385528983c48be4bf4b91beefd5a8ca9 100644
--- a/src/gpu/GrResourceCache.cpp
+++ b/src/gpu/GrResourceCache.cpp
@@ -9,6 +9,7 @@
#include "GrResourceCache.h"
#include "GrGpuResourceCacheAccess.h"
+#include "GrTracing.h"
#include "SkChecksum.h"
#include "SkGr.h"
#include "SkMessageBus.h"
@@ -108,6 +109,8 @@ void GrResourceCache::insertResource(GrGpuResource* resource) {
if (resource->resourcePriv().isBudgeted()) {
++fBudgetedCount;
fBudgetedBytes += size;
+ TRACE_COUNTER2(TRACE_DISABLED_BY_DEFAULT("skia.gpu.cache"), "skia budget", "used",
+ fBudgetedBytes, "free", fMaxBytes - fBudgetedBytes);
#if GR_CACHE_STATS
fBudgetedHighWaterCount = SkTMax(fBudgetedCount, fBudgetedHighWaterCount);
fBudgetedHighWaterBytes = SkTMax(fBudgetedBytes, fBudgetedHighWaterBytes);
@@ -137,6 +140,8 @@ void GrResourceCache::removeResource(GrGpuResource* resource) {
if (resource->resourcePriv().isBudgeted()) {
--fBudgetedCount;
fBudgetedBytes -= size;
+ TRACE_COUNTER2(TRACE_DISABLED_BY_DEFAULT("skia.gpu.cache"), "skia budget", "used",
+ fBudgetedBytes, "free", fMaxBytes - fBudgetedBytes);
}
if (resource->resourcePriv().getScratchKey().isValid()) {
@@ -351,6 +356,8 @@ void GrResourceCache::didChangeGpuMemorySize(const GrGpuResource* resource, size
#endif
if (resource->resourcePriv().isBudgeted()) {
fBudgetedBytes += delta;
+ TRACE_COUNTER2(TRACE_DISABLED_BY_DEFAULT("skia.gpu.cache"), "skia budget", "used",
+ fBudgetedBytes, "free", fMaxBytes - fBudgetedBytes);
#if GR_CACHE_STATS
fBudgetedHighWaterBytes = SkTMax(fBudgetedBytes, fBudgetedHighWaterBytes);
#endif
@@ -378,6 +385,8 @@ void GrResourceCache::didChangeBudgetStatus(GrGpuResource* resource) {
--fBudgetedCount;
fBudgetedBytes -= size;
}
+ TRACE_COUNTER2(TRACE_DISABLED_BY_DEFAULT("skia.gpu.cache"), "skia budget", "used",
+ fBudgetedBytes, "free", fMaxBytes - fBudgetedBytes);
this->validate();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698