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

Unified Diff: bench/PicturePlaybackBench.cpp

Issue 23478013: Major bench refactoring. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: merge with head agani Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « bench/PerlinNoiseBench.cpp ('k') | bench/PictureRecordBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/PicturePlaybackBench.cpp
diff --git a/bench/PicturePlaybackBench.cpp b/bench/PicturePlaybackBench.cpp
index bd84baf6b7b44f04b1b27a3ce2ade0d7343adc18..7f8fe6f06efaaa17380860b0a8a17da5e3dbdbea 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));
« no previous file with comments | « bench/PerlinNoiseBench.cpp ('k') | bench/PictureRecordBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698