aboutsummaryrefslogtreecommitdiffstats
path: root/bench
diff options
context:
space:
mode:
authorMike Reed <reed@google.com>2009-10-19 13:40:24 -0400
committerMike Reed <reed@google.com>2009-10-19 14:11:48 -0400
commit54e0f955c21365271661cd92a29d06a847a18554 (patch)
tree2af2c9f0f1731a319e1d1394b9779e66524e5496 /bench
parent4c1d4eb4c9602adf6207d1dffcbfc793cffc43e8 (diff)
downloadexternal_skia-54e0f955c21365271661cd92a29d06a847a18554.zip
external_skia-54e0f955c21365271661cd92a29d06a847a18554.tar.gz
external_skia-54e0f955c21365271661cd92a29d06a847a18554.tar.bz2
more neon opts from motorola
Diffstat (limited to 'bench')
-rw-r--r--bench/SkBenchmark.cpp5
-rw-r--r--bench/SkBenchmark.h14
-rw-r--r--bench/benchmain.cpp9
3 files changed, 28 insertions, 0 deletions
diff --git a/bench/SkBenchmark.cpp b/bench/SkBenchmark.cpp
index 8dd66f0..36280ac 100644
--- a/bench/SkBenchmark.cpp
+++ b/bench/SkBenchmark.cpp
@@ -7,6 +7,7 @@ SkBenchmark::SkBenchmark(void* defineDict) {
fDict = reinterpret_cast<const SkTDict<const char*>*>(defineDict);
fForceAlpha = 0xFF;
fForceAA = true;
+ fDither = SkTriState::kDefault;
}
const char* SkBenchmark::getName() {
@@ -25,6 +26,10 @@ void SkBenchmark::setupPaint(SkPaint* paint) {
paint->setAlpha(fForceAlpha);
paint->setAntiAlias(fForceAA);
paint->setFilterBitmap(fForceFilter);
+
+ if (SkTriState::kDefault != fDither) {
+ paint->setDither(SkTriState::kTrue == fDither);
+ }
}
const char* SkBenchmark::findDefine(const char* key) const {
diff --git a/bench/SkBenchmark.h b/bench/SkBenchmark.h
index 5ecff3b..a9c4085 100644
--- a/bench/SkBenchmark.h
+++ b/bench/SkBenchmark.h
@@ -9,6 +9,15 @@
class SkCanvas;
class SkPaint;
+class SkTriState {
+public:
+ enum State {
+ kDefault,
+ kTrue,
+ kFalse
+ };
+};
+
class SkBenchmark : public SkRefCnt {
public:
SkBenchmark(void* defineDict);
@@ -28,6 +37,10 @@ public:
void setForceFilter(bool filter) {
fForceFilter = filter;
}
+
+ void setDither(SkTriState::State state) {
+ fDither = state;
+ }
const char* findDefine(const char* key) const;
@@ -44,6 +57,7 @@ private:
int fForceAlpha;
bool fForceAA;
bool fForceFilter;
+ SkTriState::State fDither;
};
static inline SkIPoint SkMakeIPoint(int x, int y) {
diff --git a/bench/benchmain.cpp b/bench/benchmain.cpp
index 8ccb373..23a0c85 100644
--- a/bench/benchmain.cpp
+++ b/bench/benchmain.cpp
@@ -193,6 +193,7 @@ int main (int argc, char * const argv[]) {
int forceAlpha = 0xFF;
bool forceAA = true;
bool forceFilter = false;
+ SkTriState::State forceDither = SkTriState::kDefault;
bool doScale = false;
bool doRotate = false;
bool doClip = false;
@@ -243,6 +244,13 @@ int main (int argc, char * const argv[]) {
log_error("missing arg for -forceFilter\n");
return -1;
}
+ } else if (strcmp(*argv, "-forceDither") == 0) {
+ bool tmp;
+ if (!parse_bool_arg(++argv, stop, &tmp)) {
+ log_error("missing arg for -forceDither\n");
+ return -1;
+ }
+ forceDither = tmp ? SkTriState::kTrue : SkTriState::kFalse;
} else if (strcmp(*argv, "-forceBlend") == 0) {
bool wantAlpha = false;
if (!parse_bool_arg(++argv, stop, &wantAlpha)) {
@@ -303,6 +311,7 @@ int main (int argc, char * const argv[]) {
bench->setForceAlpha(forceAlpha);
bench->setForceAA(forceAA);
bench->setForceFilter(forceFilter);
+ bench->setDither(forceDither);
// only run benchmarks if their name contains matchStr
if (matchStr && strstr(bench->getName(), matchStr) == NULL) {