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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 void print(const SkRecords::Save& command, double ns) { | 53 void print(const SkRecords::Save& command, double ns) { |
54 this->printNameAndTime(command, ns); | 54 this->printNameAndTime(command, ns); |
55 ++fIndent; | 55 ++fIndent; |
56 } | 56 } |
57 | 57 |
58 void print(const SkRecords::SaveLayer& command, double ns) { | 58 void print(const SkRecords::SaveLayer& command, double ns) { |
59 this->printNameAndTime(command, ns); | 59 this->printNameAndTime(command, ns); |
60 ++fIndent; | 60 ++fIndent; |
61 } | 61 } |
62 | 62 |
| 63 void print(const SkRecords::DrawPicture& command, double ns) { |
| 64 this->printNameAndTime(command, ns); |
| 65 |
| 66 if (auto bp = command.picture->asSkBigPicture()) { |
| 67 ++fIndent; |
| 68 |
| 69 const SkRecord& record = *bp->record(); |
| 70 for (int i = 0; i < record.count(); i++) { |
| 71 record.visit<void>(i, *this); |
| 72 } |
| 73 |
| 74 --fIndent; |
| 75 } |
| 76 } |
| 77 |
63 private: | 78 private: |
64 template <typename T> | 79 template <typename T> |
65 void printNameAndTime(const T& command, double ns) { | 80 void printNameAndTime(const T& command, double ns) { |
66 int us = (int)(ns * 1e-3); | 81 int us = (int)(ns * 1e-3); |
67 if (!fTimeWithCommand) { | 82 if (!fTimeWithCommand) { |
68 printf("%6dus ", us); | 83 printf("%6dus ", us); |
69 } | 84 } |
70 printf("%*d ", fDigits, fIndex++); | 85 printf("%*d ", fDigits, fIndex++); |
71 for (int i = 0; i < fIndent; i++) { | 86 for (int i = 0; i < fIndent; i++) { |
72 printf(" "); | 87 printf(" "); |
(...skipping 27 matching lines...) Expand all Loading... |
100 } // namespace | 115 } // namespace |
101 | 116 |
102 void DumpRecord(const SkRecord& record, | 117 void DumpRecord(const SkRecord& record, |
103 SkCanvas* canvas, | 118 SkCanvas* canvas, |
104 bool timeWithCommand) { | 119 bool timeWithCommand) { |
105 Dumper dumper(canvas, record.count(), timeWithCommand); | 120 Dumper dumper(canvas, record.count(), timeWithCommand); |
106 for (int i = 0; i < record.count(); i++) { | 121 for (int i = 0; i < record.count(); i++) { |
107 record.visit<void>(i, dumper); | 122 record.visit<void>(i, dumper); |
108 } | 123 } |
109 } | 124 } |
OLD | NEW |