Bench baseline for mostly 0 image.
Add a baseline for decoding a mostly 0 image. This is in advance of
https://codereview.chromium.org/24269006/ which provides an option to
skip writing those 0s (as part of BUG=skia:1661). On my Nexus 4, the
benchmark does not slow down after that change.
As suggested in https://codereview.chromium.org/24269006/ add a
resourcePath flag to bench. Will require a change in buildbot in order
to actually use the flag.
Add an image used by the test.
Until https://codereview.chromium.org/24448002 is submitted,
the test will not actually be run by the bots (since it
won't know where to find the file).
BUG=skia:1661
R=djsollen@google.com, mtklein@google.com
Review URL: https://codereview.chromium.org/24440002
git-svn-id: http://skia.googlecode.com/svn/trunk@11461 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/bench/SkBenchmark.h b/bench/SkBenchmark.h
index 811a1db..ec40077 100644
--- a/bench/SkBenchmark.h
+++ b/bench/SkBenchmark.h
@@ -10,6 +10,7 @@
#include "SkRefCnt.h"
#include "SkPoint.h"
+#include "SkString.h"
#include "SkTRegistry.h"
#define DEF_BENCH(code) \
@@ -106,6 +107,10 @@
// for (int i = 0; i < this->getLoops(); i++) { <work here> }
int getLoops() const { return fLoops; }
+ static void SetResourcePath(const char* resPath) { gResourcePath.set(resPath); }
+
+ static SkString& GetResourcePath() { return gResourcePath; }
+
protected:
virtual void setupPaint(SkPaint* paint);
@@ -125,6 +130,7 @@
SkTriState::State fDither;
uint32_t fOrMask, fClearMask;
int fLoops;
+ static SkString gResourcePath;
typedef SkRefCnt INHERITED;
};