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 "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkColorFilterImageFilter.h" | 10 #include "SkColorFilterImageFilter.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 static sk_sp<SkImageFilter> make_mode_blue(sk_sp<SkImageFilter> input) { | 39 static sk_sp<SkImageFilter> make_mode_blue(sk_sp<SkImageFilter> input) { |
40 sk_sp<SkColorFilter> filter(SkColorFilter::MakeModeFilter(SK_ColorBLUE, | 40 sk_sp<SkColorFilter> filter(SkColorFilter::MakeModeFilter(SK_ColorBLUE, |
41 SkXfermode::kSrcIn
_Mode)); | 41 SkXfermode::kSrcIn
_Mode)); |
42 return SkColorFilterImageFilter::Make(std::move(filter), std::move(input)); | 42 return SkColorFilterImageFilter::Make(std::move(filter), std::move(input)); |
43 } | 43 } |
44 | 44 |
45 class ColorFilterBaseBench : public Benchmark { | 45 class ColorFilterBaseBench : public Benchmark { |
46 | 46 |
47 public: | 47 public: |
48 ColorFilterBaseBench(bool small) : fIsSmall(small) {} | 48 ColorFilterBaseBench(bool small) : fIsSmall(small) { } |
49 | 49 |
50 protected: | 50 protected: |
51 SkRect getFilterRect() const { | 51 SkRect getFilterRect() const { |
52 return this->isSmall() ? SkRect::MakeWH(FILTER_WIDTH_SMALL, FILTER_HEIGH
T_SMALL) : | 52 return this->isSmall() ? SkRect::MakeWH(FILTER_WIDTH_SMALL, FILTER_HEIGH
T_SMALL) : |
53 SkRect::MakeWH(FILTER_WIDTH_LARGE, FILTER_HEIGH
T_LARGE); | 53 SkRect::MakeWH(FILTER_WIDTH_LARGE, FILTER_HEIGH
T_LARGE); |
54 } | 54 } |
55 | 55 |
56 inline bool isSmall() const { return fIsSmall; } | 56 inline bool isSmall() const { return fIsSmall; } |
57 | 57 |
58 private: | 58 private: |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 DEF_BENCH( return new ColorFilterGrayBench(true); ) | 273 DEF_BENCH( return new ColorFilterGrayBench(true); ) |
274 | 274 |
275 DEF_BENCH( return new ColorFilterDimBrightBench(false); ) | 275 DEF_BENCH( return new ColorFilterDimBrightBench(false); ) |
276 DEF_BENCH( return new ColorFilterBrightGrayBench(false); ) | 276 DEF_BENCH( return new ColorFilterBrightGrayBench(false); ) |
277 DEF_BENCH( return new ColorFilterGrayBrightBench(false); ) | 277 DEF_BENCH( return new ColorFilterGrayBrightBench(false); ) |
278 DEF_BENCH( return new ColorFilterBlueBrightBench(false); ) | 278 DEF_BENCH( return new ColorFilterBlueBrightBench(false); ) |
279 DEF_BENCH( return new ColorFilterBrightBlueBench(false); ) | 279 DEF_BENCH( return new ColorFilterBrightBlueBench(false); ) |
280 DEF_BENCH( return new ColorFilterBrightBench(false); ) | 280 DEF_BENCH( return new ColorFilterBrightBench(false); ) |
281 DEF_BENCH( return new ColorFilterBlueBench(false); ) | 281 DEF_BENCH( return new ColorFilterBlueBench(false); ) |
282 DEF_BENCH( return new ColorFilterGrayBench(false); ) | 282 DEF_BENCH( return new ColorFilterGrayBench(false); ) |
OLD | NEW |