OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkColorFilter.h" | 10 #include "SkColorFilter.h" |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 } | 291 } |
292 this->drawWaterfall(canvas, paint); | 292 this->drawWaterfall(canvas, paint); |
293 | 293 |
294 acr2.restore(); | 294 acr2.restore(); |
295 canvas->translate(250, 0); | 295 canvas->translate(250, 0); |
296 } | 296 } |
297 acr.restore(); | 297 acr.restore(); |
298 canvas->translate(0, 200); | 298 canvas->translate(0, 200); |
299 } | 299 } |
300 } | 300 } |
301 | 301 |
302 private: | 302 private: |
303 typedef GM INHERITED; | 303 typedef GM INHERITED; |
304 }; | 304 }; |
305 | 305 |
306 class ImageFiltersText_IF : public ImageFiltersTextBaseGM { | 306 class ImageFiltersText_IF : public ImageFiltersTextBaseGM { |
307 public: | 307 public: |
308 ImageFiltersText_IF() : ImageFiltersTextBaseGM("image") {} | 308 ImageFiltersText_IF() : ImageFiltersTextBaseGM("image") {} |
309 | 309 |
310 void installFilter(SkPaint* paint) override { | 310 void installFilter(SkPaint* paint) override { |
311 paint->setImageFilter(SkBlurImageFilter::Create(1.5f, 1.5f))->unref(); | 311 paint->setImageFilter(SkBlurImageFilter::Create(1.5f, 1.5f))->unref(); |
312 } | 312 } |
313 }; | 313 }; |
314 DEF_GM( return new ImageFiltersText_IF; ) | 314 DEF_GM( return new ImageFiltersText_IF; ) |
315 | 315 |
316 class ImageFiltersText_CF : public ImageFiltersTextBaseGM { | 316 class ImageFiltersText_CF : public ImageFiltersTextBaseGM { |
317 public: | 317 public: |
318 ImageFiltersText_CF() : ImageFiltersTextBaseGM("color") {} | 318 ImageFiltersText_CF() : ImageFiltersTextBaseGM("color") {} |
319 | 319 |
320 void installFilter(SkPaint* paint) override { | 320 void installFilter(SkPaint* paint) override { |
321 paint->setColorFilter(SkColorFilter::MakeModeFilter(SK_ColorBLUE, SkXfer
mode::kSrcIn_Mode)); | 321 paint->setColorFilter(SkColorFilter::MakeModeFilter(SK_ColorBLUE, SkXfer
mode::kSrcIn_Mode)); |
322 } | 322 } |
323 }; | 323 }; |
324 DEF_GM( return new ImageFiltersText_CF; ) | 324 DEF_GM( return new ImageFiltersText_CF; ) |
325 | |
OLD | NEW |