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

Unified Diff: src/gpu/GrAuditTrail.cpp

Issue 1581943004: Virtualize Frames in GrAuditTrail (Closed) Base URL: https://skia.googlesource.com/skia.git@audittrail-5-debugautoframes
Patch Set: nit Created 4 years, 11 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 1113017b2d3e2e201f7e832e4df01c7e752c8d39..6ff04d114460fdec628aaaa4984af1ff70ab670f 100644
--- a/src/gpu/GrAuditTrail.cpp
+++ b/src/gpu/GrAuditTrail.cpp
@@ -7,12 +7,11 @@
#include "GrAuditTrail.h"
-template <class T>
-static void jsonify_tarray(SkString* json, const char* name, const SkTArray<T>& array) {
+void GrAuditTrail::JsonifyTArray(SkString* json, const char* name, const FrameArray& array) {
if (array.count()) {
json->appendf("\"%s\": [", name);
for (int i = 0; i < array.count(); i++) {
- json->append(array[i].toJson());
+ json->append(array[i]->toJson());
if (i < array.count() - 1) {
json->append(",");
}
@@ -91,7 +90,7 @@ static SkString pretty_print_json(SkString json) {
SkString GrAuditTrail::toJson() const {
SkString json;
json.append("{");
- jsonify_tarray(&json, "Stacks", fFrames);
+ JsonifyTArray(&json, "Stacks", fFrames);
json.append("}");
// TODO if this becomes a performance issue we should make pretty print configurable
@@ -102,13 +101,12 @@ SkString GrAuditTrail::Frame::toJson() const {
SkString json;
json.append("{");
json.appendf("\"Name\": \"%s\",", fName);
- jsonify_tarray(&json, "Batches", fBatches);
- jsonify_tarray(&json, "Frames", fChildren);
+ JsonifyTArray(&json, "Frames", fChildren);
json.append("}");
return json;
}
-SkString GrAuditTrail::Frame::Batch::toJson() const {
+SkString GrAuditTrail::Batch::toJson() const {
SkString json;
json.append("{");
json.appendf("\"Name\": \"%s\",", fName);
« 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