| 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 "BenchTimer.h" | 8 #include "BenchTimer.h" |
| 9 #include "SkCommandLineFlags.h" | 9 #include "SkCommandLineFlags.h" |
| 10 #include "SkForceLinking.h" | 10 #include "SkForceLinking.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 } | 32 } |
| 33 | 33 |
| 34 static SkPicture* rerecord_with_tilegrid(SkPicture& src) { | 34 static SkPicture* rerecord_with_tilegrid(SkPicture& src) { |
| 35 SkTileGridFactory::TileGridInfo info; | 35 SkTileGridFactory::TileGridInfo info; |
| 36 info.fTileInterval.set(FLAGS_tile, FLAGS_tile); | 36 info.fTileInterval.set(FLAGS_tile, FLAGS_tile); |
| 37 info.fMargin.setEmpty(); | 37 info.fMargin.setEmpty(); |
| 38 info.fOffset.setZero(); | 38 info.fOffset.setZero(); |
| 39 SkTileGridFactory factory(info); | 39 SkTileGridFactory factory(info); |
| 40 | 40 |
| 41 SkPictureRecorder recorder; | 41 SkPictureRecorder recorder; |
| 42 src.draw(recorder.beginRecording(src.width(), src.height(), &factory, | 42 src.draw(recorder.beginRecording(src.width(), src.height(), &factory)); |
| 43 SkPicture::kUsePathBoundsForClip_RecordingF
lag)); | |
| 44 return recorder.endRecording(); | 43 return recorder.endRecording(); |
| 45 } | 44 } |
| 46 | 45 |
| 47 static EXPERIMENTAL::SkPlayback* rerecord_with_skr(SkPicture& src) { | 46 static EXPERIMENTAL::SkPlayback* rerecord_with_skr(SkPicture& src) { |
| 48 EXPERIMENTAL::SkRecording recording(src.width(), src.height()); | 47 EXPERIMENTAL::SkRecording recording(src.width(), src.height()); |
| 49 src.draw(recording.canvas()); | 48 src.draw(recording.canvas()); |
| 50 return recording.releasePlayback(); | 49 return recording.releasePlayback(); |
| 51 } | 50 } |
| 52 | 51 |
| 53 static void bench(SkPMColor* scratch, SkPicture& src, const char* name) { | 52 static void bench(SkPMColor* scratch, SkPicture& src, const char* name) { |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 bench(scratch.get(), *src, filename.c_str()); | 116 bench(scratch.get(), *src, filename.c_str()); |
| 118 } | 117 } |
| 119 return failed ? 1 : 0; | 118 return failed ? 1 : 0; |
| 120 } | 119 } |
| 121 | 120 |
| 122 #if !defined SK_BUILD_FOR_IOS | 121 #if !defined SK_BUILD_FOR_IOS |
| 123 int main(int argc, char * const argv[]) { | 122 int main(int argc, char * const argv[]) { |
| 124 return tool_main(argc, (char**) argv); | 123 return tool_main(argc, (char**) argv); |
| 125 } | 124 } |
| 126 #endif | 125 #endif |
| OLD | NEW |