| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef GrAuditTrail_DEFINED | 8 #ifndef GrAuditTrail_DEFINED |
| 9 #define GrAuditTrail_DEFINED | 9 #define GrAuditTrail_DEFINED |
| 10 | 10 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 } | 60 } |
| 61 | 61 |
| 62 void addBatch(const char* name, const SkRect& bounds) { | 62 void addBatch(const char* name, const SkRect& bounds) { |
| 63 SkASSERT(GR_BATCH_DEBUGGING_OUTPUT && !fStack.empty()); | 63 SkASSERT(GR_BATCH_DEBUGGING_OUTPUT && !fStack.empty()); |
| 64 Batch* batch = new Batch; | 64 Batch* batch = new Batch; |
| 65 fStack.back()->fChildren.emplace_back(batch); | 65 fStack.back()->fChildren.emplace_back(batch); |
| 66 batch->fName = name; | 66 batch->fName = name; |
| 67 batch->fBounds = bounds; | 67 batch->fBounds = bounds; |
| 68 } | 68 } |
| 69 | 69 |
| 70 SkString toJson() const; | 70 SkString toJson(bool prettyPrint = false) const; |
| 71 | 71 |
| 72 void reset() { SkASSERT(GR_BATCH_DEBUGGING_OUTPUT && fStack.empty()); fFrame
s.reset(); } | 72 void reset() { SkASSERT(GR_BATCH_DEBUGGING_OUTPUT && fStack.empty()); fFrame
s.reset(); } |
| 73 | 73 |
| 74 private: | 74 private: |
| 75 // TODO if performance becomes an issue, we can move to using SkVarAlloc | 75 // TODO if performance becomes an issue, we can move to using SkVarAlloc |
| 76 struct Event { | 76 struct Event { |
| 77 virtual ~Event() {} | 77 virtual ~Event() {} |
| 78 virtual SkString toJson() const=0; | 78 virtual SkString toJson() const=0; |
| 79 | 79 |
| 80 const char* fName; | 80 const char* fName; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 107 #define GR_AUDIT_TRAIL_AUTO_FRAME(audit_trail, framename) \ | 107 #define GR_AUDIT_TRAIL_AUTO_FRAME(audit_trail, framename) \ |
| 108 GrAuditTrail::AutoFrame SK_MACRO_APPEND_LINE(auto_frame)(audit_trail, framen
ame); | 108 GrAuditTrail::AutoFrame SK_MACRO_APPEND_LINE(auto_frame)(audit_trail, framen
ame); |
| 109 | 109 |
| 110 #define GR_AUDIT_TRAIL_RESET(audit_trail) \ | 110 #define GR_AUDIT_TRAIL_RESET(audit_trail) \ |
| 111 GR_AUDIT_TRAIL_INVOKE_GUARD(audit_trail->reset); | 111 GR_AUDIT_TRAIL_INVOKE_GUARD(audit_trail->reset); |
| 112 | 112 |
| 113 #define GR_AUDIT_TRAIL_ADDBATCH(audit_trail, batchname, bounds) \ | 113 #define GR_AUDIT_TRAIL_ADDBATCH(audit_trail, batchname, bounds) \ |
| 114 GR_AUDIT_TRAIL_INVOKE_GUARD(audit_trail->addBatch, batchname, bounds); | 114 GR_AUDIT_TRAIL_INVOKE_GUARD(audit_trail->addBatch, batchname, bounds); |
| 115 | 115 |
| 116 #endif | 116 #endif |
| OLD | NEW |