Adds a bunch of benchmarks around creating, transforming, testing path equality,
and concatting paths. Also allows benchs to do setup / tear down steps outside
of the cons/destructor via new SkBenchmark virtuals.
Review URL: http://codereview.appspot.com/6454137/
git-svn-id: http://skia.googlecode.com/svn/trunk@5054 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/bench/benchmain.cpp b/bench/benchmain.cpp
index 7cfa849..0ea48e9 100644
--- a/bench/benchmain.cpp
+++ b/bench/benchmain.cpp
@@ -133,6 +133,18 @@
void* fParam;
};
+class AutoPrePostDraw {
+public:
+ AutoPrePostDraw(SkBenchmark* bench) : fBench(bench) {
+ fBench->preDraw();
+ }
+ ~AutoPrePostDraw() {
+ fBench->postDraw();
+ }
+private:
+ SkBenchmark* fBench;
+};
+
static void make_filename(const char name[], SkString* path) {
path->set(name);
for (int i = 0; name[i]; i++) {
@@ -750,6 +762,8 @@
logger.logProgress(str);
}
+ AutoPrePostDraw appd(bench);
+
for (int x = 0; x < configs.count(); ++x) {
int configIndex = configs[x];