| 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 "SkCommandLineFlags.h" | 8 #include "SkCommandLineFlags.h" |
| 9 #include "SkForceLinking.h" | 9 #include "SkForceLinking.h" |
| 10 #include "SkGraphics.h" | 10 #include "SkGraphics.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 info.fOffset.setZero(); | 54 info.fOffset.setZero(); |
| 55 return SkNEW_ARGS(SkTileGridFactory, (info)); | 55 return SkNEW_ARGS(SkTileGridFactory, (info)); |
| 56 } | 56 } |
| 57 SkDebugf("Invalid bbh type %s, must be one of rtree, tilegrid.\n", FLAGS_bbh
[0]); | 57 SkDebugf("Invalid bbh type %s, must be one of rtree, tilegrid.\n", FLAGS_bbh
[0]); |
| 58 return NULL; | 58 return NULL; |
| 59 } | 59 } |
| 60 | 60 |
| 61 static void rerecord(const SkPicture& src, SkBBHFactory* bbhFactory) { | 61 static void rerecord(const SkPicture& src, SkBBHFactory* bbhFactory) { |
| 62 SkPictureRecorder recorder; | 62 SkPictureRecorder recorder; |
| 63 if (FLAGS_skr) { | 63 if (FLAGS_skr) { |
| 64 src.draw(recorder.EXPERIMENTAL_beginRecording(src.cullRect().width(), | 64 src.playback(recorder.EXPERIMENTAL_beginRecording(src.cullRect().width()
, |
| 65 src.cullRect().height(), | 65 src.cullRect().height(), |
| 66 bbhFactory)); | 66 bbhFactory)); |
| 67 } else { | 67 } else { |
| 68 src.draw(recorder. DEPRECATED_beginRecording(src.cullRect().width(), | 68 src.playback(recorder. DEPRECATED_beginRecording(src.cullRect().width()
, |
| 69 src.cullRect().height(), | 69 src.cullRect().height(), |
| 70 bbhFactory)); | 70 bbhFactory)); |
| 71 } | 71 } |
| 72 SkAutoTUnref<SkPicture> pic(recorder.endRecording()); | 72 SkAutoTUnref<SkPicture> pic(recorder.endRecording()); |
| 73 } | 73 } |
| 74 | 74 |
| 75 static void bench_record(const SkPicture& src, | 75 static void bench_record(const SkPicture& src, |
| 76 const double timerOverhead, | 76 const double timerOverhead, |
| 77 const char* name, | 77 const char* name, |
| 78 SkBBHFactory* bbhFactory) { | 78 SkBBHFactory* bbhFactory) { |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 bench_record(*src, overheadEstimate, filename.c_str(), bbhFactory.get())
; | 168 bench_record(*src, overheadEstimate, filename.c_str(), bbhFactory.get())
; |
| 169 } | 169 } |
| 170 return failed ? 1 : 0; | 170 return failed ? 1 : 0; |
| 171 } | 171 } |
| 172 | 172 |
| 173 #if !defined SK_BUILD_FOR_IOS | 173 #if !defined SK_BUILD_FOR_IOS |
| 174 int main(int argc, char * const argv[]) { | 174 int main(int argc, char * const argv[]) { |
| 175 return tool_main(argc, (char**) argv); | 175 return tool_main(argc, (char**) argv); |
| 176 } | 176 } |
| 177 #endif | 177 #endif |
| OLD | NEW |