Index: src/gpu/GrAuditTrail.cpp |
diff --git a/src/gpu/GrAuditTrail.cpp b/src/gpu/GrAuditTrail.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3c29d5647d96d16137b6af10618f70ded769f70e |
--- /dev/null |
+++ b/src/gpu/GrAuditTrail.cpp |
@@ -0,0 +1,32 @@ |
+/* |
+ * Copyright 2016 Google Inc. |
+ * |
+ * Use of this source code is governed by a BSD-style license that can be |
+ * found in the LICENSE file. |
+ */ |
+ |
+#include "GrAuditTrail.h" |
+ |
+SkString GrAuditTrail::toJson() const { |
+ SkString json; |
+ json.append("{\n"); |
+ json.append("Ops: [\n"); |
+ for (int i = 0; i < fOps.count(); i++) { |
+ json.append(fOps[i].toJson()); |
+ if (i < fOps.count() - 1) { |
+ json.append(",\n"); |
+ } |
+ } |
+ json.append("]\n"); |
+ json.append("}\n"); |
+ return json; |
+} |
+ |
+SkString GrAuditTrail::Op::toJson() const { |
+ SkString json; |
+ json.append("{\n"); |
+ json.appendf("%s\n", fName.c_str()); |
+ json.append("}\n"); |
+ return json; |
+} |
+ |