Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: include/private/GrAuditTrail.h

Issue 1705093002: Add batch information to json (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix cpu bot Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gyp/common_conditions.gypi ('k') | src/gpu/GrAuditTrail.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « gyp/common_conditions.gypi ('k') | src/gpu/GrAuditTrail.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698