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 |