diff options
author | mtklein@google.com <mtklein@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-09-10 19:23:38 +0000 |
---|---|---|
committer | mtklein@google.com <mtklein@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-09-10 19:23:38 +0000 |
commit | c289743864e2ab926a95e617a5cd1d29b26d1825 (patch) | |
tree | 2c559da19185181efd8bd92791fb758af5969800 /bench/PicturePlaybackBench.cpp | |
parent | 55ebe8eca0063ab1f3979d629749bc41ec409ac1 (diff) |
Major bench refactoring.
- Use FLAGS_.
- Remove outer repeat loop.
- Tune inner loop automatically.
BUG=skia:1590
R=epoger@google.com, scroggo@google.com
Review URL: https://codereview.chromium.org/23478013
git-svn-id: http://skia.googlecode.com/svn/trunk@11187 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'bench/PicturePlaybackBench.cpp')
-rw-r--r-- | bench/PicturePlaybackBench.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/bench/PicturePlaybackBench.cpp b/bench/PicturePlaybackBench.cpp index bd84baf6b7..7f8fe6f06e 100644 --- a/bench/PicturePlaybackBench.cpp +++ b/bench/PicturePlaybackBench.cpp @@ -26,7 +26,6 @@ public: } enum { - N = SkBENCHLOOP(200), // number of times to playback the picture PICTURE_WIDTH = 1000, PICTURE_HEIGHT = 4000, TEXT_SIZE = 10 @@ -44,16 +43,16 @@ protected: recordCanvas(pCanvas); picture.endRecording(); - const SkPoint translateDelta = getTranslateDelta(); + const SkPoint translateDelta = getTranslateDelta(this->getLoops()); - for (int i = 0; i < N; i++) { + for (int i = 0; i < this->getLoops(); i++) { picture.draw(canvas); canvas->translate(translateDelta.fX, translateDelta.fY); } } virtual void recordCanvas(SkCanvas* canvas) = 0; - virtual SkPoint getTranslateDelta() { + virtual SkPoint getTranslateDelta(int N) { SkIPoint canvasSize = onGetSize(); return SkPoint::Make(SkIntToScalar((PICTURE_WIDTH - canvasSize.fX)/N), SkIntToScalar((PICTURE_HEIGHT- canvasSize.fY)/N)); |