aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/BitmapRectBench.cpp
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-10-31 16:31:11 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-10-31 16:31:11 +0000
commit6fcbfcead5dc1b61fa5b4c139a1a3714e8c58091 (patch)
treec7bfb4b07deb28223c78af4de69e2440f34c3427 /bench/BitmapRectBench.cpp
parent081560e3abe25c4821b79ca1465f4dbd371c4b5c (diff)
Revert "add SK_ATTR_DEPRECATED -- will need to disable for chrome, since it triggers a warning"
This reverts commit 1d22c4aaf9d8f053f25194a1ed74b137bfb19497. git-svn-id: http://skia.googlecode.com/svn/trunk@12056 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'bench/BitmapRectBench.cpp')
-rw-r--r--bench/BitmapRectBench.cpp35
1 files changed, 16 insertions, 19 deletions
diff --git a/bench/BitmapRectBench.cpp b/bench/BitmapRectBench.cpp
index 6029aebda2..104cb24bd9 100644
--- a/bench/BitmapRectBench.cpp
+++ b/bench/BitmapRectBench.cpp
@@ -39,20 +39,18 @@ static void draw_into_bitmap(const SkBitmap& bm) {
*/
class BitmapRectBench : public SkBenchmark {
- SkBitmap fBitmap;
- bool fSlightMatrix;
- uint8_t fAlpha;
- SkPaint::FilterLevel fFilterLevel;
- SkString fName;
- SkRect fSrcR, fDstR;
-
+ SkBitmap fBitmap;
+ bool fDoFilter;
+ bool fSlightMatrix;
+ uint8_t fAlpha;
+ SkString fName;
+ SkRect fSrcR, fDstR;
static const int kWidth = 128;
static const int kHeight = 128;
public:
- BitmapRectBench(U8CPU alpha, SkPaint::FilterLevel filterLevel,
- bool slightMatrix) {
+ BitmapRectBench(U8CPU alpha, bool doFilter, bool slightMatrix) {
fAlpha = SkToU8(alpha);
- fFilterLevel = filterLevel;
+ fDoFilter = doFilter;
fSlightMatrix = slightMatrix;
fBitmap.setConfig(SkBitmap::kARGB_8888_Config, kWidth, kHeight);
@@ -61,8 +59,7 @@ public:
protected:
virtual const char* onGetName() SK_OVERRIDE {
fName.printf("bitmaprect_%02X_%sfilter_%s",
- fAlpha,
- SkPaint::kNone_FilterLevel == fFilterLevel ? "no" : "",
+ fAlpha, fDoFilter ? "" : "no",
fSlightMatrix ? "trans" : "identity");
return fName.c_str();
}
@@ -92,7 +89,7 @@ protected:
SkPaint paint;
this->setupPaint(&paint);
- paint.setFilterLevel(fFilterLevel);
+ paint.setFilterBitmap(fDoFilter);
paint.setAlpha(fAlpha);
for (int i = 0; i < this->getLoops(); i++) {
@@ -104,10 +101,10 @@ private:
typedef SkBenchmark INHERITED;
};
-DEF_BENCH(return new BitmapRectBench(0xFF, SkPaint::kNone_FilterLevel, false))
-DEF_BENCH(return new BitmapRectBench(0x80, SkPaint::kNone_FilterLevel, false))
-DEF_BENCH(return new BitmapRectBench(0xFF, SkPaint::kLow_FilterLevel, false))
-DEF_BENCH(return new BitmapRectBench(0x80, SkPaint::kLow_FilterLevel, false))
+DEF_BENCH(return new BitmapRectBench(0xFF, false, false))
+DEF_BENCH(return new BitmapRectBench(0x80, false, false))
+DEF_BENCH(return new BitmapRectBench(0xFF, true, false))
+DEF_BENCH(return new BitmapRectBench(0x80, true, false))
-DEF_BENCH(return new BitmapRectBench(0xFF, SkPaint::kNone_FilterLevel, true))
-DEF_BENCH(return new BitmapRectBench(0xFF, SkPaint::kLow_FilterLevel, true))
+DEF_BENCH(return new BitmapRectBench(0xFF, false, true))
+DEF_BENCH(return new BitmapRectBench(0xFF, true, true))