| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 | 122 |
| 123 bool isEnabled() { return fEnabled; } | 123 bool isEnabled() { return fEnabled; } |
| 124 void setEnabled(bool enabled) { fEnabled = enabled; } | 124 void setEnabled(bool enabled) { fEnabled = enabled; } |
| 125 | 125 |
| 126 void setClientID(int clientID) { fClientID = clientID; } | 126 void setClientID(int clientID) { fClientID = clientID; } |
| 127 | 127 |
| 128 // We could just return our internal bookkeeping struct if copying the data
out becomes | 128 // We could just return our internal bookkeeping struct if copying the data
out becomes |
| 129 // a performance issue, but until then its nice to decouple | 129 // a performance issue, but until then its nice to decouple |
| 130 struct BatchInfo { | 130 struct BatchInfo { |
| 131 SkRect fBounds; | 131 SkRect fBounds; |
| 132 uint32_t fRenderTargetUniqueID; |
| 132 struct Batch { | 133 struct Batch { |
| 133 int fClientID; | 134 int fClientID; |
| 134 SkRect fBounds; | 135 SkRect fBounds; |
| 135 }; | 136 }; |
| 136 SkTArray<Batch> fBatches; | 137 SkTArray<Batch> fBatches; |
| 137 }; | 138 }; |
| 138 | 139 |
| 139 void getBoundsByClientID(SkTArray<BatchInfo>* outInfo, int clientID); | 140 void getBoundsByClientID(SkTArray<BatchInfo>* outInfo, int clientID); |
| 140 | 141 |
| 141 void fullReset() { | 142 void fullReset() { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 161 int fChildID; | 162 int fChildID; |
| 162 }; | 163 }; |
| 163 typedef SkTArray<SkAutoTDelete<Batch>, true> BatchPool; | 164 typedef SkTArray<SkAutoTDelete<Batch>, true> BatchPool; |
| 164 | 165 |
| 165 typedef SkTArray<Batch*> Batches; | 166 typedef SkTArray<Batch*> Batches; |
| 166 | 167 |
| 167 struct BatchNode { | 168 struct BatchNode { |
| 168 SkString toJson() const; | 169 SkString toJson() const; |
| 169 SkRect fBounds; | 170 SkRect fBounds; |
| 170 Batches fChildren; | 171 Batches fChildren; |
| 172 uint32_t fRenderTargetUniqueID; |
| 171 }; | 173 }; |
| 172 typedef SkTArray<SkAutoTDelete<BatchNode>, true> BatchList; | 174 typedef SkTArray<SkAutoTDelete<BatchNode>, true> BatchList; |
| 173 | 175 |
| 174 template <typename T> | 176 template <typename T> |
| 175 static void JsonifyTArray(SkString* json, const char* name, const T& array, | 177 static void JsonifyTArray(SkString* json, const char* name, const T& array, |
| 176 bool addComma); | 178 bool addComma); |
| 177 | 179 |
| 178 Batch* fCurrentBatch; | 180 Batch* fCurrentBatch; |
| 179 BatchPool fBatchPool; | 181 BatchPool fBatchPool; |
| 180 SkTHashMap<GrBatch*, int> fIDLookup; | 182 SkTHashMap<GrBatch*, int> fIDLookup; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 201 #define GR_AUDIT_TRAIL_ADDBATCH(audit_trail, batchname, bounds) \ | 203 #define GR_AUDIT_TRAIL_ADDBATCH(audit_trail, batchname, bounds) \ |
| 202 GR_AUDIT_TRAIL_INVOKE_GUARD(audit_trail, addBatch, batchname, bounds); | 204 GR_AUDIT_TRAIL_INVOKE_GUARD(audit_trail, addBatch, batchname, bounds); |
| 203 | 205 |
| 204 #define GR_AUDIT_TRAIL_BATCHING_RESULT_COMBINED(audit_trail, combiner) \ | 206 #define GR_AUDIT_TRAIL_BATCHING_RESULT_COMBINED(audit_trail, combiner) \ |
| 205 GR_AUDIT_TRAIL_INVOKE_GUARD(audit_trail, batchingResultCombined, combiner); | 207 GR_AUDIT_TRAIL_INVOKE_GUARD(audit_trail, batchingResultCombined, combiner); |
| 206 | 208 |
| 207 #define GR_AUDIT_TRAIL_BATCHING_RESULT_NEW(audit_trail, batch) \ | 209 #define GR_AUDIT_TRAIL_BATCHING_RESULT_NEW(audit_trail, batch) \ |
| 208 GR_AUDIT_TRAIL_INVOKE_GUARD(audit_trail, batchingResultNew, batch); | 210 GR_AUDIT_TRAIL_INVOKE_GUARD(audit_trail, batchingResultNew, batch); |
| 209 | 211 |
| 210 #endif | 212 #endif |
| OLD | NEW |