| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 SkRect rect = cropRect.rect(); | 73 SkRect rect = cropRect.rect(); |
| 74 rect.outset(SkIntToScalar(outset), | 74 rect.outset(SkIntToScalar(outset), |
| 75 SkIntToScalar(outset)); | 75 SkIntToScalar(outset)); |
| 76 SkImageFilter::CropRect bigRect(rect, SkImageFilter::CropRect::kHasA
ll_CropEdge); | 76 SkImageFilter::CropRect bigRect(rect, SkImageFilter::CropRect::kHasA
ll_CropEdge); |
| 77 | 77 |
| 78 Draw(canvas, checkerboard, rect, | 78 Draw(canvas, checkerboard, rect, |
| 79 sk_sp<SkImageFilter>(SkColorFilterImageFilter::Create(cfAlphaTr
ans.get(), | 79 sk_sp<SkImageFilter>(SkColorFilterImageFilter::Create(cfAlphaTr
ans.get(), |
| 80 noopCropp
ed.get(), | 80 noopCropp
ed.get(), |
| 81 &bigRect)
)); | 81 &bigRect)
)); |
| 82 | 82 |
| 83 Draw(canvas, checkerboard, rect, | 83 Draw(canvas, checkerboard, rect, SkBlurImageFilter::Make(0.3f, 0.3f, |
| 84 sk_sp<SkImageFilter>(SkBlurImageFilter::Create(0.3f, 0.3f, | 84 noopCropped
, |
| 85 noopCropped.get(
), | 85 &bigRect)); |
| 86 &bigRect))); | |
| 87 | 86 |
| 88 Draw(canvas, checkerboard, rect, | 87 Draw(canvas, checkerboard, rect, SkBlurImageFilter::Make(8.0f, 8.0f, |
| 89 sk_sp<SkImageFilter>(SkBlurImageFilter::Create(8.0f, 8.0f, | 88 noopCropped
, |
| 90 noopCropped.get(
), | 89 &bigRect)); |
| 91 &bigRect))); | |
| 92 | 90 |
| 93 Draw(canvas, checkerboard, rect, | 91 Draw(canvas, checkerboard, rect, |
| 94 sk_sp<SkImageFilter>(SkDilateImageFilter::Create(2, 2, | 92 sk_sp<SkImageFilter>(SkDilateImageFilter::Create(2, 2, |
| 95 noopCropped.ge
t(), | 93 noopCropped.ge
t(), |
| 96 &bigRect))); | 94 &bigRect))); |
| 97 | 95 |
| 98 Draw(canvas, checkerboard, rect, | 96 Draw(canvas, checkerboard, rect, |
| 99 sk_sp<SkImageFilter>(SkErodeImageFilter::Create(2, 2, | 97 sk_sp<SkImageFilter>(SkErodeImageFilter::Create(2, 2, |
| 100 noopCropped.get
(), | 98 noopCropped.get
(), |
| 101 &bigRect))); | 99 &bigRect))); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 | 191 |
| 194 canvas->translate(SkIntToScalar(80), 0); | 192 canvas->translate(SkIntToScalar(80), 0); |
| 195 } | 193 } |
| 196 | 194 |
| 197 typedef GM INHERITED; | 195 typedef GM INHERITED; |
| 198 }; | 196 }; |
| 199 | 197 |
| 200 /////////////////////////////////////////////////////////////////////////////// | 198 /////////////////////////////////////////////////////////////////////////////// |
| 201 | 199 |
| 202 DEF_GM( return new ImageFiltersCropExpandGM; ) | 200 DEF_GM( return new ImageFiltersCropExpandGM; ) |
| OLD | NEW |