| 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 "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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |