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 <ctype.h> | 8 #include <ctype.h> |
9 | 9 |
10 #include "Benchmark.h" | 10 #include "Benchmark.h" |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 if (FLAGS_bbh) { | 487 if (FLAGS_bbh) { |
488 // The SKP we read off disk doesn't have a BBH. Re-record s
o it grows one. | 488 // The SKP we read off disk doesn't have a BBH. Re-record s
o it grows one. |
489 // Here we use an SkTileGrid with parameters optimized for F
LAGS_clip. | 489 // Here we use an SkTileGrid with parameters optimized for F
LAGS_clip. |
490 const SkTileGridFactory::TileGridInfo info = { | 490 const SkTileGridFactory::TileGridInfo info = { |
491 SkISize::Make(fClip.width(), fClip.height()), // tile i
nterval | 491 SkISize::Make(fClip.width(), fClip.height()), // tile i
nterval |
492 SkISize::Make(0,0), // margin | 492 SkISize::Make(0,0), // margin |
493 SkIPoint::Make(fClip.left(), fClip.top()), // offset | 493 SkIPoint::Make(fClip.left(), fClip.top()), // offset |
494 }; | 494 }; |
495 SkTileGridFactory factory(info); | 495 SkTileGridFactory factory(info); |
496 SkPictureRecorder recorder; | 496 SkPictureRecorder recorder; |
497 pic->draw(recorder.beginRecording(pic->width(), pic->height(
), &factory)); | 497 pic->draw(recorder.beginRecording(pic->cullRect().width(), |
| 498 pic->cullRect().height(), |
| 499 &factory)); |
498 pic.reset(recorder.endRecording()); | 500 pic.reset(recorder.endRecording()); |
499 } | 501 } |
500 | 502 |
501 fSourceType = "skp"; | 503 fSourceType = "skp"; |
502 return SkNEW_ARGS(SKPBench, | 504 return SkNEW_ARGS(SKPBench, |
503 (name.c_str(), pic.get(), fClip, fScales[fCurrentScale])
); | 505 (name.c_str(), pic.get(), fClip, fScales[fCurrentScale])
); |
504 } | 506 } |
505 fCurrentSKP = 0; | 507 fCurrentSKP = 0; |
506 fCurrentScale++; | 508 fCurrentScale++; |
507 } | 509 } |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 | 693 |
692 return 0; | 694 return 0; |
693 } | 695 } |
694 | 696 |
695 #if !defined SK_BUILD_FOR_IOS | 697 #if !defined SK_BUILD_FOR_IOS |
696 int main(int argc, char** argv) { | 698 int main(int argc, char** argv) { |
697 SkCommandLineFlags::Parse(argc, argv); | 699 SkCommandLineFlags::Parse(argc, argv); |
698 return nanobench_main(); | 700 return nanobench_main(); |
699 } | 701 } |
700 #endif | 702 #endif |
OLD | NEW |