OLD | NEW |
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 "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 return fName.c_str(); | 35 return fName.c_str(); |
36 } | 36 } |
37 | 37 |
38 void onDelayedSetup() override { | 38 void onDelayedSetup() override { |
39 if (!fInitialized) { | 39 if (!fInitialized) { |
40 make_checkerboard(); | 40 make_checkerboard(); |
41 fInitialized = true; | 41 fInitialized = true; |
42 } | 42 } |
43 } | 43 } |
44 | 44 |
45 void onDraw(const int loops, SkCanvas* canvas) override { | 45 void onDraw(int loops, SkCanvas* canvas) override { |
46 SkPaint paint; | 46 SkPaint paint; |
47 static const SkScalar kX = 0; | 47 static const SkScalar kX = 0; |
48 static const SkScalar kY = 0; | 48 static const SkScalar kY = 0; |
49 const SkRect bmpRect = SkRect::MakeXYWH(kX, kY, | 49 const SkRect bmpRect = SkRect::MakeXYWH(kX, kY, |
50 SkIntToScalar(fCheckerboard.widt
h()), | 50 SkIntToScalar(fCheckerboard.widt
h()), |
51 SkIntToScalar(fCheckerboard.heig
ht())); | 51 SkIntToScalar(fCheckerboard.heig
ht())); |
52 const SkImageFilter::CropRect cropRect = | 52 const SkImageFilter::CropRect cropRect = |
53 SkImageFilter::CropRect(bmpRect.makeInse
t(10.f, 10.f)); | 53 SkImageFilter::CropRect(bmpRect.makeInse
t(10.f, 10.f)); |
54 const SkImageFilter::CropRect* crop = fIsCropped ? &cropRect : nullptr; | 54 const SkImageFilter::CropRect* crop = fIsCropped ? &cropRect : nullptr; |
55 | 55 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 DEF_BENCH(return new BlurImageFilterBench(0, BLUR_SIGMA_LARGE, false, true);) | 111 DEF_BENCH(return new BlurImageFilterBench(0, BLUR_SIGMA_LARGE, false, true);) |
112 DEF_BENCH(return new BlurImageFilterBench(0, BLUR_SIGMA_SMALL, false, true);) | 112 DEF_BENCH(return new BlurImageFilterBench(0, BLUR_SIGMA_SMALL, false, true);) |
113 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_MINI, BLUR_SIGMA_MINI, true
, true);) | 113 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_MINI, BLUR_SIGMA_MINI, true
, true);) |
114 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_MINI, BLUR_SIGMA_MINI, fals
e, true);) | 114 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_MINI, BLUR_SIGMA_MINI, fals
e, true);) |
115 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_SMALL, BLUR_SIGMA_SMALL, tr
ue, true);) | 115 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_SMALL, BLUR_SIGMA_SMALL, tr
ue, true);) |
116 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_SMALL, BLUR_SIGMA_SMALL, fa
lse, true);) | 116 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_SMALL, BLUR_SIGMA_SMALL, fa
lse, true);) |
117 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_LARGE, BLUR_SIGMA_LARGE, tr
ue, true);) | 117 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_LARGE, BLUR_SIGMA_LARGE, tr
ue, true);) |
118 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_LARGE, BLUR_SIGMA_LARGE, fa
lse, true);) | 118 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_LARGE, BLUR_SIGMA_LARGE, fa
lse, true);) |
119 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_HUGE, BLUR_SIGMA_HUGE, true
, true);) | 119 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_HUGE, BLUR_SIGMA_HUGE, true
, true);) |
120 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_HUGE, BLUR_SIGMA_HUGE, fals
e, true);) | 120 DEF_BENCH(return new BlurImageFilterBench(BLUR_SIGMA_HUGE, BLUR_SIGMA_HUGE, fals
e, true);) |
OLD | NEW |