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

Side by Side Diff: tools/DumpRecord.cpp

Issue 1824983003: SkRecord: infer return type for visit() and mutate(). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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 | « tests/RecorderTest.cpp ('k') | no next file » | 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 2014 Google Inc. 2 * Copyright 2014 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 #include <stdio.h> 8 #include <stdio.h>
9 9
10 #include "SkRecord.h" 10 #include "SkRecord.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 } 61 }
62 62
63 void print(const SkRecords::DrawPicture& command, double ns) { 63 void print(const SkRecords::DrawPicture& command, double ns) {
64 this->printNameAndTime(command, ns); 64 this->printNameAndTime(command, ns);
65 65
66 if (auto bp = command.picture->asSkBigPicture()) { 66 if (auto bp = command.picture->asSkBigPicture()) {
67 ++fIndent; 67 ++fIndent;
68 68
69 const SkRecord& record = *bp->record(); 69 const SkRecord& record = *bp->record();
70 for (int i = 0; i < record.count(); i++) { 70 for (int i = 0; i < record.count(); i++) {
71 record.visit<void>(i, *this); 71 record.visit(i, *this);
72 } 72 }
73 73
74 --fIndent; 74 --fIndent;
75 } 75 }
76 } 76 }
77 77
78 private: 78 private:
79 template <typename T> 79 template <typename T>
80 void printNameAndTime(const T& command, double ns) { 80 void printNameAndTime(const T& command, double ns) {
81 int us = (int)(ns * 1e-3); 81 int us = (int)(ns * 1e-3);
(...skipping 30 matching lines...) Expand all
112 const bool fTimeWithCommand; 112 const bool fTimeWithCommand;
113 }; 113 };
114 114
115 } // namespace 115 } // namespace
116 116
117 void DumpRecord(const SkRecord& record, 117 void DumpRecord(const SkRecord& record,
118 SkCanvas* canvas, 118 SkCanvas* canvas,
119 bool timeWithCommand) { 119 bool timeWithCommand) {
120 Dumper dumper(canvas, record.count(), timeWithCommand); 120 Dumper dumper(canvas, record.count(), timeWithCommand);
121 for (int i = 0; i < record.count(); i++) { 121 for (int i = 0; i < record.count(); i++) {
122 record.visit<void>(i, dumper); 122 record.visit(i, dumper);
123 } 123 }
124 } 124 }
OLDNEW
« no previous file with comments | « tests/RecorderTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698