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

Unified Diff: src/gpu/GrAuditTrail.cpp

Issue 1749163002: Wire up stack traces again (Closed) Base URL: https://skia.googlesource.com/skia@trivialcleanup
Patch Set: remove debug print Created 4 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 | « include/private/GrAuditTrail.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAuditTrail.cpp
diff --git a/src/gpu/GrAuditTrail.cpp b/src/gpu/GrAuditTrail.cpp
index d46387315eba1f0dbbeaab7f28a6700a2593653e..cf5c51053657109074b825b942ecf74dc48d0ccb 100644
--- a/src/gpu/GrAuditTrail.cpp
+++ b/src/gpu/GrAuditTrail.cpp
@@ -19,6 +19,10 @@ void GrAuditTrail::addBatch(const char* name, const SkRect& bounds) {
batch->fClientID = kGrAuditTrailInvalidID;
batch->fBatchListID = kGrAuditTrailInvalidID;
batch->fChildID = kGrAuditTrailInvalidID;
+
+ // consume the current stack trace if any
+ batch->fStackTrace = fCurrentStackTrace;
+ fCurrentStackTrace.reset();
fCurrentBatch = batch;
if (fClientID != kGrAuditTrailInvalidID) {
@@ -242,6 +246,16 @@ SkString GrAuditTrail::Batch::toJson() const {
json.appendf("\"BatchListID\": \"%d\",", fBatchListID);
json.appendf("\"ChildID\": \"%d\",", fChildID);
skrect_to_json(&json, "Bounds", fBounds);
+ if (fStackTrace.count()) {
+ json.append(",\"Stack\": [");
+ for (int i = 0; i < fStackTrace.count(); i++) {
+ json.appendf("\"%s\"", fStackTrace[i].c_str());
+ if (i < fStackTrace.count() - 1) {
+ json.append(",");
+ }
+ }
+ json.append("]");
+ }
json.append("}");
return json;
}
« no previous file with comments | « include/private/GrAuditTrail.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698