aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/ScalarBench.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-06-12 21:58:09 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-06-12 21:58:09 +0000
commitbb0b67f6596e669f8cc38a0f2bd7b00bb27f8fe2 (patch)
tree3647172cc2b13df5364997aaa609b2870709551e /bench/ScalarBench.cpp
parentd70f7307a408bd14f371108283f02aa48b53f3be (diff)
Reverting r4239 & r4240
git-svn-id: http://skia.googlecode.com/svn/trunk@4241 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'bench/ScalarBench.cpp')
-rw-r--r--bench/ScalarBench.cpp38
1 files changed, 2 insertions, 36 deletions
diff --git a/bench/ScalarBench.cpp b/bench/ScalarBench.cpp
index c03f9ca9d7..8889d7b74f 100644
--- a/bench/ScalarBench.cpp
+++ b/bench/ScalarBench.cpp
@@ -24,8 +24,7 @@ public:
protected:
virtual int mulLoopCount() const { return 1; }
- virtual const char* onGetName() SK_OVERRIDE {
- SkASSERT(!"stop");
+ virtual const char* onGetName() {
return fName.c_str();
}
@@ -81,7 +80,7 @@ private:
class ForcedIntComparisonBench : public ScalarBench {
public:
ForcedIntComparisonBench(void* param)
- : INHERITED(param, "compare_forced_int") {
+ : INHERITED(param, "compare_forced_int") {
init9(fArray);
}
protected:
@@ -99,37 +98,6 @@ private:
typedef ScalarBench INHERITED;
};
-class IsFiniteScalarBench : public ScalarBench {
-public:
- IsFiniteScalarBench(void* param) : INHERITED(param, "isfinite") {
- SkRandom rand;
- for (size_t i = 0; i < ARRAY_N; ++i) {
- fArray[i] = rand.nextSScalar1();
- }
- }
-protected:
- virtual int mulLoopCount() const { return 1; }
- virtual void performTest() SK_OVERRIDE {
- int sum = 0;
- for (size_t i = 0; i < ARRAY_N; ++i) {
- // We pass -fArray[i], so the compiler can't cheat and treat the
- // value as an int (even though we tell it that it is a float)
- sum += SkScalarIsFinite(-fArray[i]);
- }
- // we do this so the compiler won't optimize our loop away...
- this->doSomething(fArray, sum);
- }
-
- virtual void doSomething(SkScalar array[], int sum) {}
-private:
- enum {
- ARRAY_N = 64
- };
- SkScalar fArray[ARRAY_N];
-
- typedef ScalarBench INHERITED;
-};
-
///////////////////////////////////////////////////////////////////////////////
class RectBoundsBench : public SkBenchmark {
@@ -169,9 +137,7 @@ private:
static SkBenchmark* S0(void* p) { return new FloatComparisonBench(p); }
static SkBenchmark* S1(void* p) { return new ForcedIntComparisonBench(p); }
static SkBenchmark* S2(void* p) { return new RectBoundsBench(p); }
-static SkBenchmark* S3(void* p) { return new IsFiniteScalarBench(p); }
static BenchRegistry gReg0(S0);
static BenchRegistry gReg1(S1);
static BenchRegistry gReg2(S2);
-static BenchRegistry gReg3(S3);