Chromium Code Reviews| Index: include/private/GrAuditTrail.h |
| diff --git a/include/private/GrAuditTrail.h b/include/private/GrAuditTrail.h |
| index bcd85e221cb1efd6649bc9510658aacc8ba9d5b9..398d52d589b4a074182766c0c7788d66a7d2b377 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" |
| @@ -23,6 +24,13 @@ public: |
| fOps.push_back().fName = name; |
| } |
|
robertphillips
2016/01/11 21:13:55
const SkString& name ?
|
| + void addBatch(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; |
| @@ -43,9 +58,14 @@ private: |
| #define GR_AUDIT_TRAIL_ADDOP(audit_trail, opname) \ |
|
robertphillips
2016/01/11 21:13:55
Do you want to check in this SkDebugf ?
|
| + SkDebugf("%s\n", opname.c_str()); \ |
| 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 |