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

Unified Diff: bench/Benchmark.h

Issue 731973005: Add MultiPictureDraw to nanobench (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Disable multithreading in nanobench Created 6 years, 1 month 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 | « no previous file | bench/Benchmark.cpp » ('j') | bench/nanobench.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/Benchmark.h
diff --git a/bench/Benchmark.h b/bench/Benchmark.h
index 508d1da69409c2676b6b6451cfd378a5c3463438..c30167e572848b02f0b9b276b4f40f72ac94a0c6 100644
--- a/bench/Benchmark.h
+++ b/bench/Benchmark.h
@@ -70,6 +70,11 @@ public:
// before the initial draw.
void preDraw();
+ // Called once before and after a series of draw calls to a single canvas.
+ // The setup/break down in these calls is not timed.
+ void perCanvasPreDraw(SkCanvas*);
+ void perCanvasPostDraw(SkCanvas*);
+
// Bench framework can tune loops to be large enough for stable timing.
void draw(const int loops, SkCanvas*);
@@ -101,6 +106,8 @@ protected:
virtual const char* onGetName() = 0;
virtual const char* onGetUniqueName() { return this->onGetName(); }
virtual void onPreDraw() {}
+ virtual void onPerCanvasPreDraw(SkCanvas*) {}
+ virtual void onPerCanvasPostDraw(SkCanvas*) {}
// Each bench should do its main work in a loop like this:
// for (int i = 0; i < loops; i++) { <work here> }
virtual void onDraw(const int loops, SkCanvas*) = 0;
« no previous file with comments | « no previous file | bench/Benchmark.cpp » ('j') | bench/nanobench.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698