OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 "gm.h" | 8 #include "gm.h" |
9 #include "SkBlurImageFilter.h" | 9 #include "SkBlurImageFilter.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 // given offset. | 34 // given offset. |
35 class ImageMakeWithFilterGM : public skiagm::GM { | 35 class ImageMakeWithFilterGM : public skiagm::GM { |
36 public: | 36 public: |
37 ImageMakeWithFilterGM () {} | 37 ImageMakeWithFilterGM () {} |
38 | 38 |
39 protected: | 39 protected: |
40 SkString onShortName() override { | 40 SkString onShortName() override { |
41 return SkString("imagemakewithfilter"); | 41 return SkString("imagemakewithfilter"); |
42 } | 42 } |
43 | 43 |
44 SkISize onISize() override { return SkISize::Make(320, 100); } | 44 SkISize onISize() override { return SkISize::Make(440, 530); } |
45 | 45 |
46 void onDraw(SkCanvas* canvas) override { | 46 void onDraw(SkCanvas* canvas) override { |
47 auto cf = SkColorFilter::MakeModeFilter(SK_ColorGREEN, SkXfermode::kSrc_
Mode); | 47 auto cf = SkColorFilter::MakeModeFilter(SK_ColorGREEN, SkXfermode::kSrc_
Mode); |
48 sk_sp<SkImageFilter> filters[] = { | 48 sk_sp<SkImageFilter> filters[] = { |
49 SkColorFilterImageFilter::Make(std::move(cf), nullptr), | 49 SkColorFilterImageFilter::Make(std::move(cf), nullptr), |
50 SkBlurImageFilter::Make(2.0f, 2.0f, nullptr), | 50 SkBlurImageFilter::Make(2.0f, 2.0f, nullptr), |
51 SkDropShadowImageFilter::Make( | 51 SkDropShadowImageFilter::Make( |
52 10.0f, 5.0f, 3.0f, 3.0f, SK_ColorBLUE, | 52 10.0f, 5.0f, 3.0f, 3.0f, SK_ColorBLUE, |
53 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode, | 53 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode, |
54 nullptr), | 54 nullptr), |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 } | 94 } |
95 canvas->restore(); | 95 canvas->restore(); |
96 canvas->translate(0, DY); | 96 canvas->translate(0, DY); |
97 } | 97 } |
98 } | 98 } |
99 | 99 |
100 private: | 100 private: |
101 typedef GM INHERITED; | 101 typedef GM INHERITED; |
102 }; | 102 }; |
103 DEF_GM( return new ImageMakeWithFilterGM; ) | 103 DEF_GM( return new ImageMakeWithFilterGM; ) |
OLD | NEW |