| 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 "SkAlphaThresholdFilter.h" | 9 #include "SkAlphaThresholdFilter.h" |
| 10 #include "SkRandom.h" | 10 #include "SkRandom.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 } | 28 } |
| 29 | 29 |
| 30 SkPaint create_filter_paint() { | 30 SkPaint create_filter_paint() { |
| 31 SkIRect rects[2]; | 31 SkIRect rects[2]; |
| 32 rects[0] = SkIRect::MakeXYWH(0, 150, WIDTH, HEIGHT - 300); | 32 rects[0] = SkIRect::MakeXYWH(0, 150, WIDTH, HEIGHT - 300); |
| 33 rects[1] = SkIRect::MakeXYWH(150, 0, WIDTH - 300, HEIGHT); | 33 rects[1] = SkIRect::MakeXYWH(150, 0, WIDTH - 300, HEIGHT); |
| 34 SkRegion region; | 34 SkRegion region; |
| 35 region.setRects(rects, 2); | 35 region.setRects(rects, 2); |
| 36 | 36 |
| 37 SkPaint paint; | 37 SkPaint paint; |
| 38 paint.setImageFilter(SkAlphaThresholdFilter::Create(region, 0.2f, 0.7f))->un
ref(); | 38 paint.setImageFilter(SkAlphaThresholdFilter::Make(region, 0.2f, 0.7f, nullpt
r)); |
| 39 return paint; | 39 return paint; |
| 40 } | 40 } |
| 41 | 41 |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 namespace skiagm { | 44 namespace skiagm { |
| 45 | 45 |
| 46 class ImageAlphaThresholdGM : public GM { | 46 class ImageAlphaThresholdGM : public GM { |
| 47 public: | 47 public: |
| 48 ImageAlphaThresholdGM() { | 48 ImageAlphaThresholdGM() { |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 private: | 110 private: |
| 111 typedef GM INHERITED; | 111 typedef GM INHERITED; |
| 112 }; | 112 }; |
| 113 | 113 |
| 114 ////////////////////////////////////////////////////////////////////////////// | 114 ////////////////////////////////////////////////////////////////////////////// |
| 115 | 115 |
| 116 DEF_GM(return new ImageAlphaThresholdGM();) | 116 DEF_GM(return new ImageAlphaThresholdGM();) |
| 117 DEF_GM(return new ImageAlphaThresholdSurfaceGM();) | 117 DEF_GM(return new ImageAlphaThresholdSurfaceGM();) |
| 118 | 118 |
| 119 } | 119 } |
| OLD | NEW |