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

Side by Side Diff: tools/DumpRecord.cpp

Issue 732653004: option to return drawable from recording (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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/RecordDrawTest.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"
11 #include "SkRecordDraw.h" 11 #include "SkRecordDraw.h"
12 12
13 #include "DumpRecord.h" 13 #include "DumpRecord.h"
14 #include "Timer.h" 14 #include "Timer.h"
15 15
16 namespace { 16 namespace {
17 17
18 class Dumper { 18 class Dumper {
19 public: 19 public:
20 explicit Dumper(SkCanvas* canvas, int count, bool timeWithCommand) 20 explicit Dumper(SkCanvas* canvas, int count, bool timeWithCommand)
21 : fDigits(0) 21 : fDigits(0)
22 , fIndent(0) 22 , fIndent(0)
23 , fIndex(0) 23 , fIndex(0)
24 , fDraw(canvas, NULL, 0, NULL) 24 , fDraw(canvas, NULL, NULL, 0, NULL)
25 , fTimeWithCommand(timeWithCommand) { 25 , fTimeWithCommand(timeWithCommand) {
26 while (count > 0) { 26 while (count > 0) {
27 count /= 10; 27 count /= 10;
28 fDigits++; 28 fDigits++;
29 } 29 }
30 } 30 }
31 31
32 template <typename T> 32 template <typename T>
33 void operator()(const T& command) { 33 void operator()(const T& command) {
34 Timer timer; 34 Timer timer;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 } // namespace 102 } // namespace
103 103
104 void DumpRecord(const SkRecord& record, 104 void DumpRecord(const SkRecord& record,
105 SkCanvas* canvas, 105 SkCanvas* canvas,
106 bool timeWithCommand) { 106 bool timeWithCommand) {
107 Dumper dumper(canvas, record.count(), timeWithCommand); 107 Dumper dumper(canvas, record.count(), timeWithCommand);
108 for (unsigned i = 0; i < record.count(); i++) { 108 for (unsigned i = 0; i < record.count(); i++) {
109 record.visit<void>(i, dumper); 109 record.visit<void>(i, dumper);
110 } 110 }
111 } 111 }
OLDNEW
« no previous file with comments | « tests/RecordDrawTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698