OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |