diff options
author | 2016-01-14 10:58:07 -0800 | |
---|---|---|
committer | 2016-01-14 10:58:07 -0800 | |
commit | 11fae87d39811882e3e99b4abc72c9713a38da55 (patch) | |
tree | 9e11072029dfe735ed5fdfc80b059ddafe8115e2 /src/gpu/GrAuditTrail.cpp | |
parent | 8229fd5c75c1c74506faa8b65a75851db3b80590 (diff) |
Virtualize Frames in GrAuditTrail
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1581943004
Review URL: https://codereview.chromium.org/1581943004
Diffstat (limited to 'src/gpu/GrAuditTrail.cpp')
-rw-r--r-- | src/gpu/GrAuditTrail.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/gpu/GrAuditTrail.cpp b/src/gpu/GrAuditTrail.cpp index 1113017b2d..6ff04d1144 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); |