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

Unified Diff: include/private/GrAuditTrail.h

Issue 1577093003: Add batch names and bounds to json debug information (Closed) Base URL: https://skia.googlesource.com/skia.git@audittrail-wireupcontext
Patch Set: rebase 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 | « no previous file | 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 bcd85e221cb1efd6649bc9510658aacc8ba9d5b9..53f44f2173e64f7b87df0c5597bec31a5883e8ba 100644
--- a/include/private/GrAuditTrail.h
+++ b/include/private/GrAuditTrail.h
@@ -9,6 +9,7 @@
#define GrAuditTrail_DEFINED
#include "GrConfig.h"
+#include "SkRect.h"
#include "SkString.h"
#include "SkTArray.h"
@@ -18,11 +19,18 @@
*/
class GrAuditTrail {
public:
- void addOp(SkString name) {
+ void addOp(const SkString& name) {
SkASSERT(GR_BATCH_DEBUGGING_OUTPUT);
fOps.push_back().fName = name;
}
+ void addBatch(const SkString& name, const SkRect& bounds) {
+ SkASSERT(GR_BATCH_DEBUGGING_OUTPUT);
+ Op::Batch& batch = fOps.back().fBatches.push_back();
+ batch.fName = name;
+ batch.fBounds = bounds;
+ }
+
SkString toJson() const;
void reset() { SkASSERT(GR_BATCH_DEBUGGING_OUTPUT); fOps.reset(); }
@@ -30,7 +38,14 @@ public:
private:
struct Op {
SkString toJson() const;
+ struct Batch {
+ SkString toJson() const;
+ SkString fName;
+ SkRect fBounds;
+ };
+
SkString fName;
+ SkTArray<Batch> fBatches;
};
SkTArray<Op> fOps;
@@ -41,11 +56,13 @@ private:
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);
+#define GR_AUDIT_TRAIL_ADDBATCH(audit_trail, batchname, bounds) \
+ GR_AUDIT_TRAIL_INVOKE_GUARD(audit_trail->addBatch, SkString(batchname), bounds);
+
#endif
« no previous file with comments | « no previous file | src/gpu/GrAuditTrail.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698