OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 canvas->drawImage(image, 0, 0, &paint); | 61 canvas->drawImage(image, 0, 0, &paint); |
62 } | 62 } |
63 | 63 |
64 void onDraw(SkCanvas* canvas) override { | 64 void onDraw(SkCanvas* canvas) override { |
65 sk_sp<SkImage> image0(make_image(canvas)); | 65 sk_sp<SkImage> image0(make_image(canvas)); |
66 | 66 |
67 const ImageFilterFactory factories[] = { | 67 const ImageFilterFactory factories[] = { |
68 IFCCast([]{ return SkBlurImageFilter::Create(8, 8); }), | 68 IFCCast([]{ return SkBlurImageFilter::Create(8, 8); }), |
69 IFCCast([]{ return SkDilateImageFilter::Create(8, 8); }), | 69 IFCCast([]{ return SkDilateImageFilter::Create(8, 8); }), |
70 IFCCast([]{ return SkErodeImageFilter::Create(8, 8); }), | 70 IFCCast([]{ return SkErodeImageFilter::Create(8, 8); }), |
71 IFCCast([]{ return SkOffsetImageFilter::Create(8, 8); }), | 71 IFCCast([]{ return SkOffsetImageFilter::Make(8, 8, nullptr).release(
); }), |
72 }; | 72 }; |
73 | 73 |
74 const SkMatrix matrices[] = { | 74 const SkMatrix matrices[] = { |
75 SkMatrix::MakeScale(SK_ScalarHalf, SK_ScalarHalf), | 75 SkMatrix::MakeScale(SK_ScalarHalf, SK_ScalarHalf), |
76 SkMatrix::MakeScale(2, 2), | 76 SkMatrix::MakeScale(2, 2), |
77 SkMatrix::MakeTrans(10, 10) | 77 SkMatrix::MakeTrans(10, 10) |
78 }; | 78 }; |
79 | 79 |
80 const SkScalar spacer = image0->width() * 3.0f / 2; | 80 const SkScalar spacer = image0->width() * 3.0f / 2; |
81 | 81 |
(...skipping 10 matching lines...) Expand all Loading... |
92 } | 92 } |
93 canvas->restore(); | 93 canvas->restore(); |
94 canvas->translate(0, spacer); | 94 canvas->translate(0, spacer); |
95 } | 95 } |
96 } | 96 } |
97 | 97 |
98 private: | 98 private: |
99 typedef GM INHERITED; | 99 typedef GM INHERITED; |
100 }; | 100 }; |
101 DEF_GM( return new LocalMatrixImageFilterGM; ) | 101 DEF_GM( return new LocalMatrixImageFilterGM; ) |
OLD | NEW |