Reverting r4239 & r4240
authorrobertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 12 Jun 2012 21:58:09 +0000 (21:58 +0000)
committerrobertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 12 Jun 2012 21:58:09 +0000 (21:58 +0000)
git-svn-id: http://skia.googlecode.com/svn/trunk@4241 2bbb7eff-a529-9590-31e7-b0007b416f81

bench/ScalarBench.cpp

index c03f9ca..8889d7b 100644 (file)
@@ -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);