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

Side by Side Diff: tools/bench_record.cpp

Issue 492023002: Install a hook to swap between SkPicture backends with a single define. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: comment Created 6 years, 4 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 | « tools/bench_playback.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 "SkCommandLineFlags.h" 8 #include "SkCommandLineFlags.h"
9 #include "SkForceLinking.h" 9 #include "SkForceLinking.h"
10 #include "SkGraphics.h" 10 #include "SkGraphics.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 } 59 }
60 SkDebugf("Invalid bbh type %s, must be one of rtree, tilegrid, quadtree.\n", FLAGS_bbh[0]); 60 SkDebugf("Invalid bbh type %s, must be one of rtree, tilegrid, quadtree.\n", FLAGS_bbh[0]);
61 return NULL; 61 return NULL;
62 } 62 }
63 63
64 static void rerecord(const SkPicture& src, SkBBHFactory* bbhFactory) { 64 static void rerecord(const SkPicture& src, SkBBHFactory* bbhFactory) {
65 SkPictureRecorder recorder; 65 SkPictureRecorder recorder;
66 if (FLAGS_skr) { 66 if (FLAGS_skr) {
67 src.draw(recorder.EXPERIMENTAL_beginRecording(src.width(), src.height(), bbhFactory)); 67 src.draw(recorder.EXPERIMENTAL_beginRecording(src.width(), src.height(), bbhFactory));
68 } else { 68 } else {
69 src.draw(recorder.beginRecording(src.width(), src.height(), bbhFactory)) ; 69 src.draw(recorder. DEPRECATED_beginRecording(src.width(), src.height(), bbhFactory));
70 } 70 }
71 SkAutoTUnref<SkPicture> pic(recorder.endRecording()); 71 SkAutoTUnref<SkPicture> pic(recorder.endRecording());
72 } 72 }
73 73
74 static void bench_record(const SkPicture& src, 74 static void bench_record(const SkPicture& src,
75 const double timerOverhead, 75 const double timerOverhead,
76 const char* name, 76 const char* name,
77 SkBBHFactory* bbhFactory) { 77 SkBBHFactory* bbhFactory) {
78 // Rerecord once to warm up any caches. Otherwise the first sample can be v ery noisy. 78 // Rerecord once to warm up any caches. Otherwise the first sample can be v ery noisy.
79 rerecord(src, bbhFactory); 79 rerecord(src, bbhFactory);
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 bench_record(*src, overheadEstimate, filename.c_str(), bbhFactory.get()) ; 167 bench_record(*src, overheadEstimate, filename.c_str(), bbhFactory.get()) ;
168 } 168 }
169 return failed ? 1 : 0; 169 return failed ? 1 : 0;
170 } 170 }
171 171
172 #if !defined SK_BUILD_FOR_IOS 172 #if !defined SK_BUILD_FOR_IOS
173 int main(int argc, char * const argv[]) { 173 int main(int argc, char * const argv[]) {
174 return tool_main(argc, (char**) argv); 174 return tool_main(argc, (char**) argv);
175 } 175 }
176 #endif 176 #endif
OLDNEW
« no previous file with comments | « tools/bench_playback.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698