aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/BitmapBench.cpp
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-07-22 17:18:18 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-07-22 17:18:18 +0000
commit9cfc83cc8ac2ee50a7ce889e65a707941f48bdea (patch)
tree879cd1f934857a2f296d5fe9c5dbf190af1f40af /bench/BitmapBench.cpp
parent35f02fb9c9f548656e1cb2cc66d3ed20006384f8 (diff)
stop using bitmap-filter flags outside of paint itself, as a step towards really changing them into an enum
BUG= Review URL: https://codereview.chromium.org/19825002 git-svn-id: http://skia.googlecode.com/svn/trunk@10240 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'bench/BitmapBench.cpp')
-rw-r--r--bench/BitmapBench.cpp28
1 files changed, 18 insertions, 10 deletions
diff --git a/bench/BitmapBench.cpp b/bench/BitmapBench.cpp
index d8363fcb9d..a472d2489f 100644
--- a/bench/BitmapBench.cpp
+++ b/bench/BitmapBench.cpp
@@ -149,7 +149,7 @@ protected:
int count = N;
#ifdef SK_RELEASE
// in DEBUG, N is always 1
- if (paint.getFlags() & SkPaint::kHighQualityFilterBitmap_Flag) {
+ if (SkPaint::kHigh_FilterLevel == paint.getFilterLevel()) {
count /= BICUBIC_DUR_SCALE;
}
#endif
@@ -170,7 +170,7 @@ protected:
#ifdef SK_DEBUG
return 1;
#else
- return (paint.getFlags() & SkPaint::kHighQualityFilterBitmap_Flag) ?
+ return SkPaint::kHigh_FilterLevel == paint.getFilterLevel() ?
(float)BICUBIC_DUR_SCALE : 1;
#endif
}
@@ -264,19 +264,27 @@ protected:
canvas->rotate(SkIntToScalar(35));
canvas->translate(-x, -y);
}
+ INHERITED::onDraw(canvas);
+ }
- uint32_t orMask = 0;
- uint32_t clearMask = SkPaint::kFilterBitmap_Flag | SkPaint::kHighQualityFilterBitmap_Flag;
+ virtual void setupPaint(SkPaint* paint) SK_OVERRIDE {
+ this->INHERITED::setupPaint(paint);
+
+ int index = 0;
if (fFlags & kBilerp_Flag) {
- orMask |= SkPaint::kFilterBitmap_Flag;
+ index |= 1;
}
if (fFlags & kBicubic_Flag) {
- orMask |= SkPaint::kHighQualityFilterBitmap_Flag;
+ index |= 2;
}
- this->setPaintMasks(orMask, clearMask);
-
- INHERITED::onDraw(canvas);
- }
+ static const SkPaint::FilterLevel gLevels[] = {
+ SkPaint::kNone_FilterLevel,
+ SkPaint::kLow_FilterLevel,
+ SkPaint::kMedium_FilterLevel,
+ SkPaint::kHigh_FilterLevel
+ };
+ paint->setFilterLevel(gLevels[index]);
+}
private:
typedef BitmapBench INHERITED;