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/ImageFilterDAGBench.cpp

Issue 359473004: draft gpu support in nanobench (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: winders Created 6 years, 6 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/nanobench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/ImageFilterDAGBench.cpp
diff --git a/bench/ImageFilterDAGBench.cpp b/bench/ImageFilterDAGBench.cpp
index 29d1da1a6125bf7ed30031a03733fd5a7b7de48b..680628e0e0d6d9ab6b6884acff1c804f5b9cbdb8 100644
--- a/bench/ImageFilterDAGBench.cpp
+++ b/bench/ImageFilterDAGBench.cpp
@@ -18,8 +18,7 @@ enum { kNumInputs = 5 };
class ImageFilterDAGBench : public Benchmark {
public:
- ImageFilterDAGBench() {
- }
+ ImageFilterDAGBench() {}
protected:
virtual const char* onGetName() SK_OVERRIDE {
@@ -27,16 +26,18 @@ protected:
}
virtual void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE {
- SkAutoTUnref<SkImageFilter> blur(SkBlurImageFilter::Create(20.0f, 20.0f));
- SkImageFilter* inputs[kNumInputs];
- for (int i = 0; i < kNumInputs; ++i) {
- inputs[i] = blur.get();
+ for (int j = 0; j < loops; j++) {
+ SkAutoTUnref<SkImageFilter> blur(SkBlurImageFilter::Create(20.0f, 20.0f));
+ SkImageFilter* inputs[kNumInputs];
+ for (int i = 0; i < kNumInputs; ++i) {
+ inputs[i] = blur.get();
+ }
+ SkAutoTUnref<SkImageFilter> merge(SkMergeImageFilter::Create(inputs, kNumInputs));
+ SkPaint paint;
+ paint.setImageFilter(merge);
+ SkRect rect = SkRect::Make(SkIRect::MakeWH(400, 400));
+ canvas->drawRect(rect, paint);
}
- SkAutoTUnref<SkImageFilter> merge(SkMergeImageFilter::Create(inputs, kNumInputs));
- SkPaint paint;
- paint.setImageFilter(merge);
- SkRect rect = SkRect::Make(SkIRect::MakeWH(400, 400));
- canvas->drawRect(rect, paint);
}
private:
« no previous file with comments | « no previous file | bench/nanobench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698