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

Unified Diff: bench/benchmain.cpp

Issue 99893003: Simplify benchmark internal API. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 7 years 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/XfermodeBench.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/benchmain.cpp
diff --git a/bench/benchmain.cpp b/bench/benchmain.cpp
index 697f4fb6ccae8450b893a2510f63e214bfdcb57c..dcfc710ef1dfff4a9e956691b59a54925d993dff 100644
--- a/bench/benchmain.cpp
+++ b/bench/benchmain.cpp
@@ -516,7 +516,7 @@ int tool_main(int argc, char** argv) {
canvas.reset(SkRef(recordTo.beginRecording(dim.fX, dim.fY, kRecordFlags)));
break;
case kPictureRecord_BenchMode:
- bench->draw(recordFrom.beginRecording(dim.fX, dim.fY, kRecordFlags));
+ bench->draw(1, recordFrom.beginRecording(dim.fX, dim.fY, kRecordFlags));
recordFrom.endRecording();
canvas.reset(SkRef(recordTo.beginRecording(dim.fX, dim.fY, kRecordFlags)));
break;
@@ -591,18 +591,19 @@ int tool_main(int argc, char** argv) {
// Save and restore around each call to draw() to guarantee a pristine canvas.
SkAutoCanvasRestore saveRestore(canvas, true/*also save*/);
+ int loops;
if (frameIntervalComputed && loopCount > loopsPerFrame) {
- bench->setLoops(loopsPerFrame);
+ loops = loopsPerFrame;
loopCount -= loopsPerFrame;
} else {
- bench->setLoops(loopCount);
+ loops = loopCount;
loopCount = 0;
}
if (benchMode == kPictureRecord_BenchMode) {
recordFrom.draw(canvas);
} else {
- bench->draw(canvas);
+ bench->draw(loops, canvas);
}
if (kDeferredSilent_BenchMode == benchMode) {
« no previous file with comments | « bench/XfermodeBench.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698