| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |