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 "gm.h" | 8 #include "gm.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkBlurImageFilter.h" | 10 #include "SkBlurImageFilter.h" |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 class ApplyFilterGM : public skiagm::GM { | 147 class ApplyFilterGM : public skiagm::GM { |
148 public: | 148 public: |
149 ApplyFilterGM() {} | 149 ApplyFilterGM() {} |
150 | 150 |
151 protected: | 151 protected: |
152 SkString onShortName() override { | 152 SkString onShortName() override { |
153 return SkString("apply-filter"); | 153 return SkString("apply-filter"); |
154 } | 154 } |
155 | 155 |
156 SkISize onISize() override { | 156 SkISize onISize() override { |
157 return SkISize::Make(640, 480); | 157 return SkISize::Make(780, 780); |
158 } | 158 } |
159 | 159 |
160 void onDraw(SkCanvas* canvas) override { | 160 void onDraw(SkCanvas* canvas) override { |
161 SkAutoTUnref<SkImage> image0(make_image(canvas)); | 161 SkAutoTUnref<SkImage> image0(make_image(canvas)); |
162 | 162 |
163 const ImageFilterFactory factories[] = { | 163 const ImageFilterFactory factories[] = { |
164 IFCCast([]{ return SkBlurImageFilter::Create(8, 8); }), | 164 IFCCast([]{ return SkBlurImageFilter::Create(8, 8); }), |
165 IFCCast([]{ SkAutoTUnref<SkColorFilter> cf(SkModeColorFilter::Create
(SK_ColorBLUE, | 165 IFCCast([]{ SkAutoTUnref<SkColorFilter> cf(SkModeColorFilter::Create
(SK_ColorBLUE, |
166 SkXfermode:
:kSrcIn_Mode)); | 166 SkXfermode:
:kSrcIn_Mode)); |
167 return SkColorFilterImageFilter::Create(cf); | 167 return SkColorFilterImageFilter::Create(cf); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 | 208 |
209 canvas->translate(0, spacer); | 209 canvas->translate(0, spacer); |
210 } | 210 } |
211 } | 211 } |
212 | 212 |
213 private: | 213 private: |
214 typedef GM INHERITED; | 214 typedef GM INHERITED; |
215 }; | 215 }; |
216 DEF_GM( return new ApplyFilterGM; ) | 216 DEF_GM( return new ApplyFilterGM; ) |
217 | 217 |
OLD | NEW |