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

Side by Side Diff: tools/bench_playback.cpp

Issue 231853006: SkRecord: turn on cull annotation pass in public API. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 8 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 | « src/record/SkRecording.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 "SkCommandLineFlags.h" 8 #include "SkCommandLineFlags.h"
9 #include "SkForceLinking.h" 9 #include "SkForceLinking.h"
10 #include "SkGraphics.h" 10 #include "SkGraphics.h"
11 #include "SkOSFile.h" 11 #include "SkOSFile.h"
12 #include "SkPicture.h" 12 #include "SkPicture.h"
13 #include "SkRecordDraw.h" 13 #include "SkRecordDraw.h"
14 #include "SkRecorder.h" 14 #include "SkRecorder.h"
15 #include "SkStream.h" 15 #include "SkStream.h"
16 #include "SkString.h" 16 #include "SkString.h"
17 #include "SkTime.h" 17 #include "SkTime.h"
18 18
19 __SK_FORCE_IMAGE_DECODER_LINKING; 19 __SK_FORCE_IMAGE_DECODER_LINKING;
20 20
21 DEFINE_string2(skps, r, "skps", "Directory containing SKPs to read and re-record ."); 21 DEFINE_string2(skps, r, "skps", "Directory containing SKPs to read and re-record .");
22 DEFINE_int32(loops, 10, "Number of times to play back each SKP."); 22 DEFINE_int32(loops, 10, "Number of times to play back each SKP.");
23 DEFINE_bool(skr, false, "Play via SkRecord instead of SkPicture."); 23 DEFINE_bool(skr, false, "Play via SkRecord instead of SkPicture.");
24 DEFINE_int32(tile, 1000000000, "Simulated tile size."); 24 DEFINE_int32(tile, 1000000000, "Simulated tile size.");
25 25
26 static void bench(SkPMColor* scratch, SkPicture& src, const char* name) { 26 static void bench(SkPMColor* scratch, SkPicture& src, const char* name) {
27 // We don't use the public SkRecording interface here because we need kWrite Only_Mode.
28 // (We don't want SkPicturePlayback to be able to optimize playing into our SkRecord.)
27 SkRecord record; 29 SkRecord record;
28 SkRecorder recorder(SkRecorder::kWriteOnly_Mode, &record, src.width(), src.h eight()); 30 SkRecorder recorder(SkRecorder::kWriteOnly_Mode, &record, src.width(), src.h eight());
29 src.draw(&recorder); 31 src.draw(&recorder);
30 32
31 SkAutoTDelete<SkCanvas> canvas(SkCanvas::NewRasterDirectN32(src.width(), 33 SkAutoTDelete<SkCanvas> canvas(SkCanvas::NewRasterDirectN32(src.width(),
32 src.height(), 34 src.height(),
33 scratch, 35 scratch,
34 src.width() * si zeof(SkPMColor))); 36 src.width() * si zeof(SkPMColor)));
35 canvas->clipRect(SkRect::MakeWH(SkIntToScalar(FLAGS_tile), SkIntToScalar(FLA GS_tile))); 37 canvas->clipRect(SkRect::MakeWH(SkIntToScalar(FLAGS_tile), SkIntToScalar(FLA GS_tile)));
36 38
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 bench(scratch.get(), *src, filename.c_str()); 88 bench(scratch.get(), *src, filename.c_str());
87 } 89 }
88 return failed ? 1 : 0; 90 return failed ? 1 : 0;
89 } 91 }
90 92
91 #if !defined SK_BUILD_FOR_IOS 93 #if !defined SK_BUILD_FOR_IOS
92 int main(int argc, char * const argv[]) { 94 int main(int argc, char * const argv[]) {
93 return tool_main(argc, (char**) argv); 95 return tool_main(argc, (char**) argv);
94 } 96 }
95 #endif 97 #endif
OLDNEW
« no previous file with comments | « src/record/SkRecording.cpp ('k') | tools/bench_record.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698