| 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 "SkOffsetImageFilter.h" | 10 #include "SkOffsetImageFilter.h" |
| 11 #include "SkCanvas.h" | 11 #include "SkCanvas.h" |
| 12 #include "SkPaint.h" | 12 #include "SkPaint.h" |
| 13 #include "SkRandom.h" | 13 #include "SkRandom.h" |
| 14 #include "SkShader.h" | 14 #include "SkShader.h" |
| 15 #include "SkString.h" | 15 #include "SkString.h" |
| 16 | 16 |
| 17 #define FILTER_WIDTH_SMALL 32 | 17 #define FILTER_WIDTH_SMALL 32 |
| 18 #define FILTER_HEIGHT_SMALL 32 | 18 #define FILTER_HEIGHT_SMALL 32 |
| 19 #define FILTER_WIDTH_LARGE 256 | 19 #define FILTER_WIDTH_LARGE 256 |
| 20 #define FILTER_HEIGHT_LARGE 256 | 20 #define FILTER_HEIGHT_LARGE 256 |
| 21 #define BLUR_SIGMA_MINI 0.5f | 21 #define BLUR_SIGMA_MINI 0.5f |
| 22 #define BLUR_SIGMA_SMALL 1.0f | 22 #define BLUR_SIGMA_SMALL 1.0f |
| 23 #define BLUR_SIGMA_LARGE 10.0f | 23 #define BLUR_SIGMA_LARGE 10.0f |
| 24 #define BLUR_SIGMA_HUGE 80.0f | 24 #define BLUR_SIGMA_HUGE 80.0f |
| 25 | 25 |
| 26 | 26 |
| 27 // When 'cropped' is set we apply a cropRect to the blurImageFilter. The crop re
ct is an inset of | 27 // When 'cropped' is set we apply a cropRect to the blurImageFilter. The crop re
ct is an inset of |
| 28 // the source's natural dimensions. This is intended to exercise blurring a larg
er source bitmap | 28 // the source's natural dimensions. This is intended to exercise blurring a larg
er source bitmap |
| 29 // to a smaller destination bitmap. | 29 // to a smaller destination bitmap. |
| 30 | 30 |
| 31 // When 'expanded' is set we apply a cropRect to the input of the blurImageFilte
r (a noOp | 31 // When 'expanded' is set we apply a cropRect to the input of the blurImageFilte
r (a noOp |
| 32 // offsetImageFilter). The crop rect in this case is an inset of the source's na
tural dimensions. | 32 // offsetImageFilter). The crop rect in this case is an inset of the source's na
tural dimensions. |
| 33 // An additional crop rect is applied to the blurImageFilter that is just the na
tural dimensions | 33 // An additional crop rect is applied to the blurImageFilter that is just the na
tural dimensions |
| 34 // of the source (not inset). This is intended to exercise blurring a smaller so
urce bitmap to a | 34 // of the source (not inset). This is intended to exercise blurring a smaller so
urce bitmap to a |
| 35 // larger destination. | 35 // larger destination. |
| 36 | 36 |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 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
);) |
| 154 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
);) |
| 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, true
, 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_MINI, BLUR_SIGMA_MINI, fals
e, 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, tr
ue, 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_SMALL, BLUR_SIGMA_SMALL, fa
lse, 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, tr
ue, 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_LARGE, BLUR_SIGMA_LARGE, fa
lse, 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, true
, true, true);) |
| 162 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);) |
| OLD | NEW |