Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1038)

Unified Diff: bench/BitmapBench.cpp

Issue 23478013: Major bench refactoring. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: merge with head agani Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « bench/BicubicBench.cpp ('k') | bench/BitmapRectBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/BitmapBench.cpp
diff --git a/bench/BitmapBench.cpp b/bench/BitmapBench.cpp
index a472d2489f19cabfba6cda2481d3cc46ed7d47d6..698a680e9cb76ce21e079b199258e12858f0e594 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)
« no previous file with comments | « bench/BicubicBench.cpp ('k') | bench/BitmapRectBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698