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

Side by Side Diff: tools/bench_playback.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 | « tests/PictureTest.cpp ('k') | tools/bench_record.cpp » ('j') | 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 "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkCommandLineFlags.h" 9 #include "SkCommandLineFlags.h"
10 #include "SkForceLinking.h" 10 #include "SkForceLinking.h"
(...skipping 27 matching lines...) Expand all
38 38
39 static SkPicture* rerecord(const SkPicture& src, bool skr) { 39 static SkPicture* rerecord(const SkPicture& src, bool skr) {
40 SkTileGridFactory::TileGridInfo info; 40 SkTileGridFactory::TileGridInfo info;
41 info.fTileInterval.set(FLAGS_tile, FLAGS_tile); 41 info.fTileInterval.set(FLAGS_tile, FLAGS_tile);
42 info.fMargin.setEmpty(); 42 info.fMargin.setEmpty();
43 info.fOffset.setZero(); 43 info.fOffset.setZero();
44 SkTileGridFactory factory(info); 44 SkTileGridFactory factory(info);
45 45
46 SkPictureRecorder recorder; 46 SkPictureRecorder recorder;
47 src.draw(skr ? recorder.EXPERIMENTAL_beginRecording(src.width(), src.height( ), &factory) 47 src.draw(skr ? recorder.EXPERIMENTAL_beginRecording(src.width(), src.height( ), &factory)
48 : recorder. beginRecording(src.width(), src.height( ), &factory)); 48 : recorder. DEPRECATED_beginRecording(src.width(), src.height( ), &factory));
49 return recorder.endRecording(); 49 return recorder.endRecording();
50 } 50 }
51 51
52 static void bench(SkPMColor* scratch, const SkPicture& src, const char* name) { 52 static void bench(SkPMColor* scratch, const SkPicture& src, const char* name) {
53 SkAutoTUnref<const SkPicture> picture(rerecord(src, FLAGS_skr)); 53 SkAutoTUnref<const SkPicture> picture(rerecord(src, FLAGS_skr));
54 54
55 SkAutoTDelete<SkCanvas> canvas(SkCanvas::NewRasterDirectN32(src.width(), 55 SkAutoTDelete<SkCanvas> canvas(SkCanvas::NewRasterDirectN32(src.width(),
56 src.height(), 56 src.height(),
57 scratch, 57 scratch,
58 src.width() * si zeof(SkPMColor))); 58 src.width() * si zeof(SkPMColor)));
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 bench(scratch.get(), *src, filename.c_str()); 131 bench(scratch.get(), *src, filename.c_str());
132 } 132 }
133 return failed ? 1 : 0; 133 return failed ? 1 : 0;
134 } 134 }
135 135
136 #if !defined SK_BUILD_FOR_IOS 136 #if !defined SK_BUILD_FOR_IOS
137 int main(int argc, char * const argv[]) { 137 int main(int argc, char * const argv[]) {
138 return tool_main(argc, (char**) argv); 138 return tool_main(argc, (char**) argv);
139 } 139 }
140 #endif 140 #endif
OLDNEW
« no previous file with comments | « tests/PictureTest.cpp ('k') | tools/bench_record.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698