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

Unified Diff: bench/BitmapRectBench.cpp

Issue 54603004: Revert "Revert "add SK_ATTR_DEPRECATED -- will need to disable for chrome, since it triggers a warn… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 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/GameBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/BitmapRectBench.cpp
diff --git a/bench/BitmapRectBench.cpp b/bench/BitmapRectBench.cpp
index 104cb24bd90e51c6d00dd28ece3a1f29e7f69380..6029aebda2d1df1e2d581283c431998e8f1ac2c6 100644
--- a/bench/BitmapRectBench.cpp
+++ b/bench/BitmapRectBench.cpp
@@ -39,18 +39,20 @@ static void draw_into_bitmap(const SkBitmap& bm) {
*/
class BitmapRectBench : public SkBenchmark {
- SkBitmap fBitmap;
- bool fDoFilter;
- bool fSlightMatrix;
- uint8_t fAlpha;
- SkString fName;
- SkRect fSrcR, fDstR;
+ SkBitmap fBitmap;
+ bool fSlightMatrix;
+ uint8_t fAlpha;
+ SkPaint::FilterLevel fFilterLevel;
+ SkString fName;
+ SkRect fSrcR, fDstR;
+
static const int kWidth = 128;
static const int kHeight = 128;
public:
- BitmapRectBench(U8CPU alpha, bool doFilter, bool slightMatrix) {
+ BitmapRectBench(U8CPU alpha, SkPaint::FilterLevel filterLevel,
+ bool slightMatrix) {
fAlpha = SkToU8(alpha);
- fDoFilter = doFilter;
+ fFilterLevel = filterLevel;
fSlightMatrix = slightMatrix;
fBitmap.setConfig(SkBitmap::kARGB_8888_Config, kWidth, kHeight);
@@ -59,7 +61,8 @@ public:
protected:
virtual const char* onGetName() SK_OVERRIDE {
fName.printf("bitmaprect_%02X_%sfilter_%s",
- fAlpha, fDoFilter ? "" : "no",
+ fAlpha,
+ SkPaint::kNone_FilterLevel == fFilterLevel ? "no" : "",
fSlightMatrix ? "trans" : "identity");
return fName.c_str();
}
@@ -89,7 +92,7 @@ protected:
SkPaint paint;
this->setupPaint(&paint);
- paint.setFilterBitmap(fDoFilter);
+ paint.setFilterLevel(fFilterLevel);
paint.setAlpha(fAlpha);
for (int i = 0; i < this->getLoops(); i++) {
@@ -101,10 +104,10 @@ private:
typedef SkBenchmark INHERITED;
};
-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, 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, true))
-DEF_BENCH(return new BitmapRectBench(0xFF, true, true))
+DEF_BENCH(return new BitmapRectBench(0xFF, SkPaint::kNone_FilterLevel, true))
+DEF_BENCH(return new BitmapRectBench(0xFF, SkPaint::kLow_FilterLevel, true))
« no previous file with comments | « no previous file | bench/GameBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698