aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/BitmapBench.cpp
diff options
context:
space:
mode:
authorGravatar mtklein@google.com <mtklein@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-09-10 19:23:38 +0000
committerGravatar mtklein@google.com <mtklein@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-09-10 19:23:38 +0000
commitc289743864e2ab926a95e617a5cd1d29b26d1825 (patch)
tree2c559da19185181efd8bd92791fb758af5969800 /bench/BitmapBench.cpp
parent55ebe8eca0063ab1f3979d629749bc41ec409ac1 (diff)
Major bench refactoring.
- Use FLAGS_. - Remove outer repeat loop. - Tune inner loop automatically. BUG=skia:1590 R=epoger@google.com, scroggo@google.com Review URL: https://codereview.chromium.org/23478013 git-svn-id: http://skia.googlecode.com/svn/trunk@11187 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'bench/BitmapBench.cpp')
-rw-r--r--bench/BitmapBench.cpp23
1 files changed, 1 insertions, 22 deletions
diff --git a/bench/BitmapBench.cpp b/bench/BitmapBench.cpp
index a472d2489f..698a680e9c 100644
--- a/bench/BitmapBench.cpp
+++ b/bench/BitmapBench.cpp
@@ -81,8 +81,6 @@ class BitmapBench : public SkBenchmark {
bool fIsVolatile;
SkBitmap::Config fConfig;
SkString fName;
- enum { BICUBIC_DUR_SCALE = 20 };
- enum { N = SkBENCHLOOP(15 * BICUBIC_DUR_SCALE) };
enum { W = 128 };
enum { H = 128 };
public:
@@ -146,14 +144,7 @@ protected:
const SkScalar x0 = SkIntToScalar(-bitmap.width() / 2);
const SkScalar y0 = SkIntToScalar(-bitmap.height() / 2);
- int count = N;
-#ifdef SK_RELEASE
- // in DEBUG, N is always 1
- if (SkPaint::kHigh_FilterLevel == paint.getFilterLevel()) {
- count /= BICUBIC_DUR_SCALE;
- }
-#endif
- for (int i = 0; i < count; i++) {
+ for (int i = 0; i < this->getLoops(); i++) {
SkScalar x = x0 + rand.nextUScalar1() * dim.fX;
SkScalar y = y0 + rand.nextUScalar1() * dim.fY;
@@ -164,17 +155,6 @@ protected:
}
}
- virtual float onGetDurationScale() SK_OVERRIDE {
- SkPaint paint;
- this->setupPaint(&paint);
-#ifdef SK_DEBUG
- return 1;
-#else
- return SkPaint::kHigh_FilterLevel == paint.getFilterLevel() ?
- (float)BICUBIC_DUR_SCALE : 1;
-#endif
- }
-
virtual void onDrawIntoBitmap(const SkBitmap& bm) {
const int w = bm.width();
const int h = bm.height();
@@ -219,7 +199,6 @@ static bool isBicubic(uint32_t flags) {
class FilterBitmapBench : public BitmapBench {
uint32_t fFlags;
SkString fFullName;
- enum { N = SkBENCHLOOP(300) };
public:
FilterBitmapBench(void* param, bool isOpaque, SkBitmap::Config c,
bool forceUpdate, bool isVolitile, uint32_t flags)