Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(343)

Side by Side Diff: bench/nanobench.cpp

Issue 540963002: Change SkPicture::draw to playback (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 if (FLAGS_bbh) { 484 if (FLAGS_bbh) {
485 // The SKP we read off disk doesn't have a BBH. Re-record s o it grows one. 485 // The SKP we read off disk doesn't have a BBH. Re-record s o it grows one.
486 // Here we use an SkTileGrid with parameters optimized for F LAGS_clip. 486 // Here we use an SkTileGrid with parameters optimized for F LAGS_clip.
487 const SkTileGridFactory::TileGridInfo info = { 487 const SkTileGridFactory::TileGridInfo info = {
488 SkISize::Make(fClip.width(), fClip.height()), // tile i nterval 488 SkISize::Make(fClip.width(), fClip.height()), // tile i nterval
489 SkISize::Make(0,0), // margin 489 SkISize::Make(0,0), // margin
490 SkIPoint::Make(fClip.left(), fClip.top()), // offset 490 SkIPoint::Make(fClip.left(), fClip.top()), // offset
491 }; 491 };
492 SkTileGridFactory factory(info); 492 SkTileGridFactory factory(info);
493 SkPictureRecorder recorder; 493 SkPictureRecorder recorder;
494 pic->draw(recorder.beginRecording(pic->cullRect().width(), 494 pic->playback(recorder.beginRecording(pic->cullRect().width( ),
495 pic->cullRect().height(), 495 pic->cullRect().height (),
496 &factory)); 496 &factory));
497 pic.reset(recorder.endRecording()); 497 pic.reset(recorder.endRecording());
498 } 498 }
499 499
500 fSourceType = "skp"; 500 fSourceType = "skp";
501 return SkNEW_ARGS(SKPBench, 501 return SkNEW_ARGS(SKPBench,
502 (name.c_str(), pic.get(), fClip, fScales[fCurrentScale]) ); 502 (name.c_str(), pic.get(), fClip, fScales[fCurrentScale]) );
503 } 503 }
504 fCurrentSKP = 0; 504 fCurrentSKP = 0;
505 fCurrentScale++; 505 fCurrentScale++;
506 } 506 }
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 690
691 return 0; 691 return 0;
692 } 692 }
693 693
694 #if !defined SK_BUILD_FOR_IOS 694 #if !defined SK_BUILD_FOR_IOS
695 int main(int argc, char** argv) { 695 int main(int argc, char** argv) {
696 SkCommandLineFlags::Parse(argc, argv); 696 SkCommandLineFlags::Parse(argc, argv);
697 return nanobench_main(); 697 return nanobench_main();
698 } 698 }
699 #endif 699 #endif
OLDNEW
« no previous file with comments | « bench/SKPBench.cpp ('k') | debugger/SkDebugger.cpp » ('j') | include/core/SkPicture.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698