Index: include/private/GrAuditTrail.h |
diff --git a/include/private/GrAuditTrail.h b/include/private/GrAuditTrail.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..02b971ef448c0fe4fa82a3c2cf8747f796717550 |
--- /dev/null |
+++ b/include/private/GrAuditTrail.h |
@@ -0,0 +1,37 @@ |
+/* |
+ * Copyright 2016 Google Inc. |
+ * |
+ * Use of this source code is governed by a BSD-style license that can be |
+ * found in the LICENSE file. |
+ */ |
+ |
+#ifndef GrAuditTrail_DEFINED |
+#define GrAuditTrail_DEFINED |
+ |
+#include "SkString.h" |
+#include "SkTArray.h" |
+ |
+/* |
+ * GrAuditTrail collects a list of draw ops, detailed information about those ops, and can dump them |
+ * to json. |
+ */ |
+class GrAuditTrail { |
+public: |
+ void addOp(SkString name) { |
+ fOps.push_back().fName = name; |
+ } |
+ |
+ SkString toJson() const; |
+ |
+ void reset() { fOps.reset(); } |
+ |
+private: |
+ struct Op { |
+ SkString toJson() const; |
+ SkString fName; |
+ }; |
+ |
+ SkTArray<Op> fOps; |
+}; |
+ |
+#endif |