diff options
author | Brian Osman <brianosman@google.com> | 2019-01-28 13:41:19 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2019-01-28 19:06:06 +0000 |
commit | d8a90f9be1f068dd8231cc6c9e9d490d17e7ece6 (patch) | |
tree | 50e719471da0dfd97378a7dcf888e4860bf1b193 /include | |
parent | 41f0e28fd5bd11a7ebf5400f1f046d882de1e4a7 (diff) | |
download | platform_external_skqp-d8a90f9be1f068dd8231cc6c9e9d490d17e7ece6.tar.gz platform_external_skqp-d8a90f9be1f068dd8231cc6c9e9d490d17e7ece6.tar.bz2 platform_external_skqp-d8a90f9be1f068dd8231cc6c9e9d490d17e7ece6.zip |
Converting more debug code to SkJSONWriter
All of SkDrawCommand / SkDebugCanvas now uses SkJSONWriter.
Also removed the bespoke json generator and pretty-printer
in GrAuditTrail. This was the largest volume of code still
using JsonCPP. (There are other stragglers).
Bug: skia:
Change-Id: I3aee554764689ce50c8e707caf26c76093b9bb8f
Reviewed-on: https://skia-review.googlesource.com/c/187040
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/private/GrAuditTrail.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/private/GrAuditTrail.h b/include/private/GrAuditTrail.h index 2e0a5dd697..2d48af89ef 100644 --- a/include/private/GrAuditTrail.h +++ b/include/private/GrAuditTrail.h @@ -17,6 +17,7 @@ #include "SkTHash.h" class GrOp; +class SkJSONWriter; /* * GrAuditTrail collects a list of draw ops, detailed information about those ops, and can dump them @@ -91,10 +92,10 @@ public: // this means is that for some sequence of draw calls N, the below toJson calls will only // produce JSON which reflects N draw calls. This JSON may or may not be accurate for N + 1 or // N - 1 draws depending on the actual combining algorithm used. - SkString toJson(bool prettyPrint = false) const; + void toJson(SkJSONWriter& writer) const; // returns a json string of all of the ops associated with a given client id - SkString toJson(int clientID, bool prettyPrint = false) const; + void toJson(SkJSONWriter& writer, int clientID) const; bool isEnabled() { return fEnabled; } void setEnabled(bool enabled) { fEnabled = enabled; } @@ -124,7 +125,7 @@ public: private: // TODO if performance becomes an issue, we can move to using SkVarAlloc struct Op { - SkString toJson() const; + void toJson(SkJSONWriter& writer) const; SkString fName; SkTArray<SkString> fStackTrace; SkRect fBounds; @@ -138,7 +139,7 @@ private: struct OpNode { OpNode(const GrSurfaceProxy::UniqueID& proxyID) : fProxyUniqueID(proxyID) { } - SkString toJson() const; + void toJson(SkJSONWriter& writer) const; SkRect fBounds; Ops fChildren; @@ -149,8 +150,7 @@ private: void copyOutFromOpList(OpInfo* outOpInfo, int opListID); template <typename T> - static void JsonifyTArray(SkString* json, const char* name, const T& array, - bool addComma); + static void JsonifyTArray(SkJSONWriter& writer, const char* name, const T& array); OpPool fOpPool; SkTHashMap<uint32_t, int> fIDLookup; |