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

Side by Side Diff: bench/BlurImageFilterBench.cpp

Issue 1518643002: SkBlurImageFilter returns input when sigma = 0 (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: clean up Created 5 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | gm/imageblur.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "Benchmark.h" 8 #include "Benchmark.h"
9 #include "SkBlurImageFilter.h" 9 #include "SkBlurImageFilter.h"
10 #include "SkOffsetImageFilter.h" 10 #include "SkOffsetImageFilter.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 SkIntToScalar(fCheckerboard.heig ht())); 73 SkIntToScalar(fCheckerboard.heig ht()));
74 const SkImageFilter::CropRect cropRect(bmpRect.makeInset(10.f, 10.f)); 74 const SkImageFilter::CropRect cropRect(bmpRect.makeInset(10.f, 10.f));
75 const SkImageFilter::CropRect cropRectLarge(bmpRect); 75 const SkImageFilter::CropRect cropRectLarge(bmpRect);
76 SkAutoTUnref<SkImageFilter> noOpCropped(SkOffsetImageFilter::Create(0, 0 , nullptr, 76 SkAutoTUnref<SkImageFilter> noOpCropped(SkOffsetImageFilter::Create(0, 0 , nullptr,
77 &cropRect)); 77 &cropRect));
78 78
79 SkImageFilter* input = fIsExpanded ? noOpCropped.get() : nullptr; 79 SkImageFilter* input = fIsExpanded ? noOpCropped.get() : nullptr;
80 80
81 const SkImageFilter::CropRect* crop = 81 const SkImageFilter::CropRect* crop =
82 fIsExpanded ? &cropRectLarge : fIsCropped ? &cropRect : nullptr; 82 fIsExpanded ? &cropRectLarge : fIsCropped ? &cropRect : nullptr;
83 paint.setImageFilter(SkBlurImageFilter::Create(fSigmaX, fSigmaY, input, crop))->unref(); 83 SkAutoTUnref<SkImageFilter> blur(SkBlurImageFilter::Create(fSigmaX, fSig maY, input, crop));
84 paint.setImageFilter(blur);
84 85
85 for (int i = 0; i < loops; i++) { 86 for (int i = 0; i < loops; i++) {
86 canvas->drawBitmap(fCheckerboard, kX, kY, &paint); 87 canvas->drawBitmap(fCheckerboard, kX, kY, &paint);
87 } 88 }
88 } 89 }
89 90
90 private: 91 private:
91 void make_checkerboard() { 92 void make_checkerboard() {
92 const int w = fIsSmall ? FILTER_WIDTH_SMALL : FILTER_WIDTH_LARGE; 93 const int w = fIsSmall ? FILTER_WIDTH_SMALL : FILTER_WIDTH_LARGE;
93 const int h = fIsSmall ? FILTER_HEIGHT_LARGE : FILTER_HEIGHT_LARGE; 94 const int h = fIsSmall ? FILTER_HEIGHT_LARGE : FILTER_HEIGHT_LARGE;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 DEF_BENCH(return new BlurImageFilterBench(0, BLUR_SIGMA_LARGE, false, true, true );) 153 DEF_BENCH(return new BlurImageFilterBench(0, BLUR_SIGMA_LARGE, false, true, true );)
153 DEF_BENCH(return new BlurImageFilterBench(0, BLUR_SIGMA_SMALL, false, true, true );) 154 DEF_BENCH(return new BlurImageFilterBench(0, BLUR_SIGMA_SMALL, false, true, true );)
154 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_MINI, BLUR_SIGMA_MINI, true , true, true);) 155 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_MINI, BLUR_SIGMA_MINI, true , true, true);)
155 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_MINI, BLUR_SIGMA_MINI, fals e, true, true);) 156 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_MINI, BLUR_SIGMA_MINI, fals e, true, true);)
156 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_SMALL, BLUR_SIGMA_SMALL, tr ue, true, true);) 157 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_SMALL, BLUR_SIGMA_SMALL, tr ue, true, true);)
157 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_SMALL, BLUR_SIGMA_SMALL, fa lse, true, true);) 158 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_SMALL, BLUR_SIGMA_SMALL, fa lse, true, true);)
158 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_LARGE, BLUR_SIGMA_LARGE, tr ue, true, true);) 159 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_LARGE, BLUR_SIGMA_LARGE, tr ue, true, true);)
159 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_LARGE, BLUR_SIGMA_LARGE, fa lse, true, true);) 160 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_LARGE, BLUR_SIGMA_LARGE, fa lse, true, true);)
160 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_HUGE, BLUR_SIGMA_HUGE, true , true, true);) 161 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_HUGE, BLUR_SIGMA_HUGE, true , true, true);)
161 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_HUGE, BLUR_SIGMA_HUGE, fals e, true, true);) 162 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_HUGE, BLUR_SIGMA_HUGE, fals e, true, true);)
OLDNEW
« no previous file with comments | « no previous file | gm/imageblur.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698