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

Unified Diff: bench/ColorFilterBench.cpp

Issue 1055383002: remove useless benches (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/ColorFilterBench.cpp
diff --git a/bench/ColorFilterBench.cpp b/bench/ColorFilterBench.cpp
index 04803b57b3a6ce85b1f92382086ed3fcc1c0c59c..4f7f1517dd5b0767e22770b7177bcbbbf4b601a8 100644
--- a/bench/ColorFilterBench.cpp
+++ b/bench/ColorFilterBench.cpp
@@ -4,6 +4,7 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
+
#include "Benchmark.h"
#include "SkCanvas.h"
#include "SkColorFilterImageFilter.h"
@@ -19,7 +20,7 @@
class ColorFilterBaseBench : public Benchmark {
public:
- ColorFilterBaseBench(bool small) : fIsSmall(small) { }
+ ColorFilterBaseBench(bool small) : fIsSmall(small) {}
protected:
SkRect getFilterRect() const {
@@ -55,6 +56,7 @@ protected:
}
inline bool isSmall() const { return fIsSmall; }
+
private:
bool fIsSmall;
@@ -254,8 +256,7 @@ private:
class ColorFilterGrayBench : public ColorFilterBaseBench {
public:
- ColorFilterGrayBench(bool small) : INHERITED(small) {
- }
+ ColorFilterGrayBench(bool small) : INHERITED(small) {}
protected:
const char* onGetName() override {
@@ -277,71 +278,6 @@ private:
typedef ColorFilterBaseBench INHERITED;
};
-class TableColorFilterBench : public ColorFilterBaseBench {
-
-public:
- TableColorFilterBench(bool small) : INHERITED(small) {
- }
-
-protected:
- const char* onGetName() override {
- return isSmall() ? "table_colorfilter_small" : "table_colorfilter_large";
- }
-
- void onDraw(const int loops, SkCanvas* canvas) override {
- SkRect r = getFilterRect();
- SkPaint paint;
- paint.setColor(SK_ColorRED);
- for (int i = 0; i < loops; i++) {
- SkAutoTUnref<SkColorFilter> table_filter(make_table_filter());
- paint.setColorFilter(table_filter);
- canvas->drawRect(r, paint);
- }
- }
-
-private:
- static void fill_table_data(uint8_t table[]) {
- for (int i = 0; i < 256; ++i) {
- int n = i >> 5;
- table[i] = (n << 5) | (n << 2) | (n >> 1);
- }
- }
-
- static SkColorFilter* make_table_filter() {
- uint8_t table[256]; fill_table_data(table);
- return SkTableColorFilter::Create(table);
- }
-
- typedef ColorFilterBaseBench INHERITED;
-};
-
-class LumaColorFilterBench : public ColorFilterBaseBench {
-
-public:
- LumaColorFilterBench(bool small) : INHERITED(small) {
- }
-
-protected:
- const char* onGetName() override {
- return isSmall() ? "luma_colorfilter_small" : "luma_colorfilter_large";
- }
-
- void onDraw(const int loops, SkCanvas* canvas) override {
- SkRect r = getFilterRect();
- SkPaint paint;
- paint.setColor(SK_ColorRED);
-
- for (int i = 0; i < loops; i++) {
- SkAutoTUnref<SkColorFilter> luma_filter(SkLumaColorFilter::Create());
- paint.setColorFilter(luma_filter);
- canvas->drawRect(r, paint);
- }
- }
-
-private:
- typedef ColorFilterBaseBench INHERITED;
-};
-
///////////////////////////////////////////////////////////////////////////////
DEF_BENCH( return new ColorFilterDimBrightBench(true); )
@@ -352,8 +288,6 @@ DEF_BENCH( return new ColorFilterBrightBlueBench(true); )
DEF_BENCH( return new ColorFilterBrightBench(true); )
DEF_BENCH( return new ColorFilterBlueBench(true); )
DEF_BENCH( return new ColorFilterGrayBench(true); )
-DEF_BENCH( return new TableColorFilterBench(true); )
-DEF_BENCH( return new LumaColorFilterBench(true); )
DEF_BENCH( return new ColorFilterDimBrightBench(false); )
DEF_BENCH( return new ColorFilterBrightGrayBench(false); )
@@ -363,5 +297,3 @@ DEF_BENCH( return new ColorFilterBrightBlueBench(false); )
DEF_BENCH( return new ColorFilterBrightBench(false); )
DEF_BENCH( return new ColorFilterBlueBench(false); )
DEF_BENCH( return new ColorFilterGrayBench(false); )
-DEF_BENCH( return new TableColorFilterBench(false); )
-DEF_BENCH( return new LumaColorFilterBench(false); )
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698