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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 SkImageFilter* filters[] = { | 60 SkImageFilter* filters[] = { |
61 SkBlurImageFilter::Create(5, 5), | 61 SkBlurImageFilter::Create(5, 5), |
62 SkDropShadowImageFilter::Create(10, 10, 3, 3, SK_ColorGREEN, | 62 SkDropShadowImageFilter::Create(10, 10, 3, 3, SK_ColorGREEN, |
63 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode), | 63 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode), |
64 SkOffsetImageFilter::Create(-16, 32), | 64 SkOffsetImageFilter::Make(-16, 32, nullptr).release(), |
65 SkImageFilter::CreateMatrixFilter(resizeMatrix, kNone_SkFilterQualit
y), | 65 SkImageFilter::CreateMatrixFilter(resizeMatrix, kNone_SkFilterQualit
y), |
66 }; | 66 }; |
67 | 67 |
68 SkRect r = SkRect::MakeWH(64, 64); | 68 SkRect r = SkRect::MakeWH(64, 64); |
69 SkScalar margin = 32; | 69 SkScalar margin = 32; |
70 SkPaint paint; | 70 SkPaint paint; |
71 paint.setColor(SK_ColorWHITE); | 71 paint.setColor(SK_ColorWHITE); |
72 paint.setAntiAlias(true); | 72 paint.setAntiAlias(true); |
73 paint.setStrokeWidth(10); | 73 paint.setStrokeWidth(10); |
74 paint.setStyle(SkPaint::kStroke_Style); | 74 paint.setStyle(SkPaint::kStroke_Style); |
(...skipping 28 matching lines...) Expand all Loading... |
103 | 103 |
104 private: | 104 private: |
105 typedef GM INHERITED; | 105 typedef GM INHERITED; |
106 }; | 106 }; |
107 | 107 |
108 ////////////////////////////////////////////////////////////////////////////// | 108 ////////////////////////////////////////////////////////////////////////////// |
109 | 109 |
110 DEF_GM(return new ImageFiltersStrokedGM;) | 110 DEF_GM(return new ImageFiltersStrokedGM;) |
111 | 111 |
112 } | 112 } |
OLD | NEW |