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 "sk_tool_utils.h" | 8 #include "sk_tool_utils.h" |
9 #include "SkBlurImageFilter.h" | 9 #include "SkBlurImageFilter.h" |
10 #include "SkColor.h" | 10 #include "SkColor.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 draw_line, draw_rect, draw_circle, | 52 draw_line, draw_rect, draw_circle, |
53 }; | 53 }; |
54 | 54 |
55 canvas->clear(SK_ColorBLACK); | 55 canvas->clear(SK_ColorBLACK); |
56 | 56 |
57 SkMatrix resizeMatrix; | 57 SkMatrix resizeMatrix; |
58 resizeMatrix.setScale(RESIZE_FACTOR_X, RESIZE_FACTOR_Y); | 58 resizeMatrix.setScale(RESIZE_FACTOR_X, RESIZE_FACTOR_Y); |
59 | 59 |
60 sk_sp<SkImageFilter> filters[] = { | 60 sk_sp<SkImageFilter> filters[] = { |
61 SkBlurImageFilter::Make(5, 5, nullptr), | 61 SkBlurImageFilter::Make(5, 5, nullptr), |
62 sk_sp<SkImageFilter>(SkDropShadowImageFilter::Create(10, 10, 3, 3, S
K_ColorGREEN, | 62 SkDropShadowImageFilter::Make(10, 10, 3, 3, SK_ColorGREEN, |
63 SkDropShadowImageFilter::kDrawShadowAndForeground_Sh
adowMode)), | 63 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode, |
| 64 nullptr), |
64 SkOffsetImageFilter::Make(-16, 32, nullptr), | 65 SkOffsetImageFilter::Make(-16, 32, nullptr), |
65 SkImageFilter::MakeMatrixFilter(resizeMatrix, kNone_SkFilterQuality,
nullptr), | 66 SkImageFilter::MakeMatrixFilter(resizeMatrix, kNone_SkFilterQuality,
nullptr), |
66 }; | 67 }; |
67 | 68 |
68 SkRect r = SkRect::MakeWH(64, 64); | 69 SkRect r = SkRect::MakeWH(64, 64); |
69 SkScalar margin = 32; | 70 SkScalar margin = 32; |
70 SkPaint paint; | 71 SkPaint paint; |
71 paint.setColor(SK_ColorWHITE); | 72 paint.setColor(SK_ColorWHITE); |
72 paint.setAntiAlias(true); | 73 paint.setAntiAlias(true); |
73 paint.setStrokeWidth(10); | 74 paint.setStrokeWidth(10); |
(...skipping 25 matching lines...) Expand all Loading... |
99 | 100 |
100 private: | 101 private: |
101 typedef GM INHERITED; | 102 typedef GM INHERITED; |
102 }; | 103 }; |
103 | 104 |
104 ////////////////////////////////////////////////////////////////////////////// | 105 ////////////////////////////////////////////////////////////////////////////// |
105 | 106 |
106 DEF_GM(return new ImageFiltersStrokedGM;) | 107 DEF_GM(return new ImageFiltersStrokedGM;) |
107 | 108 |
108 } | 109 } |
OLD | NEW |