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

Unified Diff: bench/BitmapBench.cpp

Issue 19825002: stop using bitmap-filter flags outside of paint itself, as a step towards really changing them into… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 5 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 | « no previous file | bench/BitmapScaleBench.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 d8363fcb9dc7e7f05152503cd502a69076149ebd..a472d2489f19cabfba6cda2481d3cc46ed7d47d6 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;
« no previous file with comments | « no previous file | bench/BitmapScaleBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698