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

Unified Diff: include/private/GrAuditTrail.h

Issue 1565113004: Change to wire up opnames in SkGpuDevice (Closed) Base URL: https://skia.googlesource.com/skia.git@audittrail-initial
Patch Set: add a bunch of macros to interact with GrAuditTrail 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/gpu/GrContext.h ('k') | src/gpu/GrAuditTrail.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/private/GrAuditTrail.h
diff --git a/include/private/GrAuditTrail.h b/include/private/GrAuditTrail.h
index 02b971ef448c0fe4fa82a3c2cf8747f796717550..bcd85e221cb1efd6649bc9510658aacc8ba9d5b9 100644
--- a/include/private/GrAuditTrail.h
+++ b/include/private/GrAuditTrail.h
@@ -8,6 +8,7 @@
#ifndef GrAuditTrail_DEFINED
#define GrAuditTrail_DEFINED
+#include "GrConfig.h"
#include "SkString.h"
#include "SkTArray.h"
@@ -18,12 +19,13 @@
class GrAuditTrail {
public:
void addOp(SkString name) {
+ SkASSERT(GR_BATCH_DEBUGGING_OUTPUT);
fOps.push_back().fName = name;
}
SkString toJson() const;
- void reset() { fOps.reset(); }
+ void reset() { SkASSERT(GR_BATCH_DEBUGGING_OUTPUT); fOps.reset(); }
private:
struct Op {
@@ -34,4 +36,16 @@ private:
SkTArray<Op> fOps;
};
+#define GR_AUDIT_TRAIL_INVOKE_GUARD(invoke, ...) \
+ if (GR_BATCH_DEBUGGING_OUTPUT) { \
+ invoke(__VA_ARGS__); \
+ }
+
+
+#define GR_AUDIT_TRAIL_ADDOP(audit_trail, opname) \
+ GR_AUDIT_TRAIL_INVOKE_GUARD(audit_trail->addOp, opname);
+
+#define GR_AUDIT_TRAIL_RESET(audit_trail) \
+ GR_AUDIT_TRAIL_INVOKE_GUARD(audit_trail->reset);
+
#endif
« no previous file with comments | « include/gpu/GrContext.h ('k') | src/gpu/GrAuditTrail.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698