aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrAuditTrail.cpp
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2016-03-02 08:11:34 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-02 08:11:34 -0800
commitf55c3644850409c9410051c7a7f18af8d65bf990 (patch)
tree2a0da5a04a491e9e24467b5dd2c2ce610943c769 /src/gpu/GrAuditTrail.cpp
parentcb6cb3841adec77d178c6d6ed006102077fd3c48 (diff)
Wire up stack traces again
Diffstat (limited to 'src/gpu/GrAuditTrail.cpp')
-rw-r--r--src/gpu/GrAuditTrail.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gpu/GrAuditTrail.cpp b/src/gpu/GrAuditTrail.cpp
index d46387315e..cf5c510536 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;
}