| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 struct Frame : public Event { | 85 struct Frame : public Event { |
| 86 SkString toJson() const override; | 86 SkString toJson() const override; |
| 87 FrameArray fChildren; | 87 FrameArray fChildren; |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 struct Batch : public Event { | 90 struct Batch : public Event { |
| 91 SkString toJson() const override; | 91 SkString toJson() const override; |
| 92 SkRect fBounds; | 92 SkRect fBounds; |
| 93 }; | 93 }; |
| 94 | 94 |
| 95 static void JsonifyTArray(SkString* json, const char* name, const FrameArray
& array); | 95 static void JsonifyTArray(SkString* json, const char* name, const FrameArray
& array, |
| 96 bool addComma); |
| 96 | 97 |
| 97 FrameArray fFrames; | 98 FrameArray fFrames; |
| 98 SkTArray<Frame*> fStack; | 99 SkTArray<Frame*> fStack; |
| 99 uint64_t fUniqueID; | 100 uint64_t fUniqueID; |
| 100 }; | 101 }; |
| 101 | 102 |
| 102 #define GR_AUDIT_TRAIL_INVOKE_GUARD(invoke, ...) \ | 103 #define GR_AUDIT_TRAIL_INVOKE_GUARD(invoke, ...) \ |
| 103 if (GR_BATCH_DEBUGGING_OUTPUT) { \ | 104 if (GR_BATCH_DEBUGGING_OUTPUT) { \ |
| 104 invoke(__VA_ARGS__); \ | 105 invoke(__VA_ARGS__); \ |
| 105 } | 106 } |
| 106 | 107 |
| 107 #define GR_AUDIT_TRAIL_AUTO_FRAME(audit_trail, framename) \ | 108 #define GR_AUDIT_TRAIL_AUTO_FRAME(audit_trail, framename) \ |
| 108 GrAuditTrail::AutoFrame SK_MACRO_APPEND_LINE(auto_frame)(audit_trail, framen
ame); | 109 GrAuditTrail::AutoFrame SK_MACRO_APPEND_LINE(auto_frame)(audit_trail, framen
ame); |
| 109 | 110 |
| 110 #define GR_AUDIT_TRAIL_RESET(audit_trail) \ | 111 #define GR_AUDIT_TRAIL_RESET(audit_trail) \ |
| 111 GR_AUDIT_TRAIL_INVOKE_GUARD(audit_trail->reset); | 112 GR_AUDIT_TRAIL_INVOKE_GUARD(audit_trail->reset); |
| 112 | 113 |
| 113 #define GR_AUDIT_TRAIL_ADDBATCH(audit_trail, batchname, bounds) \ | 114 #define GR_AUDIT_TRAIL_ADDBATCH(audit_trail, batchname, bounds) \ |
| 114 GR_AUDIT_TRAIL_INVOKE_GUARD(audit_trail->addBatch, batchname, bounds); | 115 GR_AUDIT_TRAIL_INVOKE_GUARD(audit_trail->addBatch, batchname, bounds); |
| 115 | 116 |
| 116 #endif | 117 #endif |
| OLD | NEW |