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

Unified Diff: bench/ColorFilterBench.cpp

Issue 23478013: Major bench refactoring. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: merge with head agani Created 7 years, 3 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 | « bench/CmapBench.cpp ('k') | bench/DashBench.cpp » ('j') | 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 22a0472b1b9f0777e3e4089a3f8c78a7465d7a0a..2ac78ae128831bbbfdc0396e2b3b8fdf6ba3cc44 100644
--- a/bench/ColorFilterBench.cpp
+++ b/bench/ColorFilterBench.cpp
@@ -76,11 +76,14 @@ protected:
SkRect r = getFilterRect();
SkPaint paint;
paint.setColor(SK_ColorRED);
- for (float brightness = -1.0f; brightness <= 1.0f; brightness += 0.4f) {
- SkAutoTUnref<SkImageFilter> dim(make_brightness(-brightness));
- SkAutoTUnref<SkImageFilter> bright(make_brightness(brightness, dim));
- paint.setImageFilter(bright);
- canvas->drawRect(r, paint);
+
+ for (int i = 0; i < this->getLoops(); i++) {
+ for (float brightness = -1.0f; brightness <= 1.0f; brightness += 0.4f) {
+ SkAutoTUnref<SkImageFilter> dim(make_brightness(-brightness));
+ SkAutoTUnref<SkImageFilter> bright(make_brightness(brightness, dim));
+ paint.setImageFilter(bright);
+ canvas->drawRect(r, paint);
+ }
}
}
@@ -103,7 +106,7 @@ protected:
SkRect r = getFilterRect();
SkPaint paint;
paint.setColor(SK_ColorRED);
- {
+ for (int i = 0; i < this->getLoops(); i++) {
SkAutoTUnref<SkImageFilter> brightness(make_brightness(0.9f));
SkAutoTUnref<SkImageFilter> grayscale(make_grayscale(brightness));
paint.setImageFilter(grayscale);
@@ -130,7 +133,7 @@ protected:
SkRect r = getFilterRect();
SkPaint paint;
paint.setColor(SK_ColorRED);
- {
+ for (int i = 0; i < this->getLoops(); i++) {
SkAutoTUnref<SkImageFilter> grayscale(make_grayscale());
SkAutoTUnref<SkImageFilter> brightness(make_brightness(0.9f, grayscale));
paint.setImageFilter(brightness);
@@ -157,7 +160,7 @@ protected:
SkRect r = getFilterRect();
SkPaint paint;
paint.setColor(SK_ColorRED);
- {
+ for (int i = 0; i < this->getLoops(); i++) {
SkAutoTUnref<SkImageFilter> blue(make_mode_blue());
SkAutoTUnref<SkImageFilter> brightness(make_brightness(1.0f, blue));
paint.setImageFilter(brightness);
@@ -184,7 +187,7 @@ protected:
SkRect r = getFilterRect();
SkPaint paint;
paint.setColor(SK_ColorRED);
- {
+ for (int i = 0; i < this->getLoops(); i++) {
SkAutoTUnref<SkImageFilter> brightness(make_brightness(1.0f));
SkAutoTUnref<SkImageFilter> blue(make_mode_blue(brightness));
paint.setImageFilter(blue);
@@ -211,7 +214,7 @@ protected:
SkRect r = getFilterRect();
SkPaint paint;
paint.setColor(SK_ColorRED);
- {
+ for (int i = 0; i < this->getLoops(); i++) {
SkAutoTUnref<SkImageFilter> brightness(make_brightness(1.0f));
paint.setImageFilter(brightness);
canvas->drawRect(r, paint);
@@ -237,7 +240,7 @@ protected:
SkRect r = getFilterRect();
SkPaint paint;
paint.setColor(SK_ColorRED);
- {
+ for (int i = 0; i < this->getLoops(); i++) {
SkAutoTUnref<SkImageFilter> blue(make_mode_blue());
paint.setImageFilter(blue);
canvas->drawRect(r, paint);
@@ -263,7 +266,7 @@ protected:
SkRect r = getFilterRect();
SkPaint paint;
paint.setColor(SK_ColorRED);
- {
+ for (int i = 0; i < this->getLoops(); i++) {
SkAutoTUnref<SkImageFilter> grayscale(make_grayscale());
paint.setImageFilter(grayscale);
canvas->drawRect(r, paint);
@@ -289,7 +292,7 @@ protected:
SkRect r = getFilterRect();
SkPaint paint;
paint.setColor(SK_ColorRED);
- {
+ for (int i = 0; i < this->getLoops(); i++) {
SkAutoTUnref<SkColorFilter> table_filter(make_table_filter());
paint.setColorFilter(table_filter);
canvas->drawRect(r, paint);
« no previous file with comments | « bench/CmapBench.cpp ('k') | bench/DashBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698