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 | 9 |
10 #include "Sk2DPathEffect.h" | 10 #include "Sk2DPathEffect.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 SkScalar fSkewX; | 59 SkScalar fSkewX; |
60 bool fEffect; | 60 bool fEffect; |
61 }; | 61 }; |
62 | 62 |
63 static void mask_filter(SkPaint* paint) { | 63 static void mask_filter(SkPaint* paint) { |
64 SkMaskFilter* mf = SkBlurMaskFilter::Create(kNormal_SkBlurStyle, | 64 SkMaskFilter* mf = SkBlurMaskFilter::Create(kNormal_SkBlurStyle, |
65 SkBlurMask::ConvertRadiusToSigma(3.f)); | 65 SkBlurMask::ConvertRadiusToSigma(3.f)); |
66 paint->setMaskFilter(mf)->unref(); | 66 paint->setMaskFilter(mf)->unref(); |
67 } | 67 } |
68 | 68 |
69 static sk_sp<SkPathEffect> make_tile_effect() { | 69 static SkPathEffect* make_tile_effect() { |
70 SkMatrix m; | 70 SkMatrix m; |
71 m.setScale(1.f, 1.f); | 71 m.setScale(1.f, 1.f); |
72 | 72 |
73 SkPath path; | 73 SkPath path; |
74 path.addCircle(0, 0, SkIntToScalar(5)); | 74 path.addCircle(0, 0, SkIntToScalar(5)); |
75 | 75 |
76 return SkPath2DPathEffect::Make(m, path); | 76 return SkPath2DPathEffect::Create(m, path); |
77 } | 77 } |
78 | 78 |
79 static void path_effect(SkPaint* paint) { | 79 static void path_effect(SkPaint* paint) { |
80 paint->setPathEffect(make_tile_effect()); | 80 paint->setPathEffect(make_tile_effect())->unref(); |
81 } | 81 } |
82 | 82 |
83 static sk_sp<SkShader> make_shader(const SkRect& bounds) { | 83 static sk_sp<SkShader> make_shader(const SkRect& bounds) { |
84 const SkPoint pts[] = { | 84 const SkPoint pts[] = { |
85 { bounds.left(), bounds.top() }, | 85 { bounds.left(), bounds.top() }, |
86 { bounds.right(), bounds.bottom() }, | 86 { bounds.right(), bounds.bottom() }, |
87 }; | 87 }; |
88 const SkColor colors[] = { | 88 const SkColor colors[] = { |
89 SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorBLACK, | 89 SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorBLACK, |
90 SK_ColorCYAN, SK_ColorMAGENTA, SK_ColorYELLOW, | 90 SK_ColorCYAN, SK_ColorMAGENTA, SK_ColorYELLOW, |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 SkAutoTUnref<const SkTextBlob> fBlob; | 249 SkAutoTUnref<const SkTextBlob> fBlob; |
250 SkTArray<SkAutoTUnref<SkLayerDrawLooper>, true> fLoopers; | 250 SkTArray<SkAutoTUnref<SkLayerDrawLooper>, true> fLoopers; |
251 | 251 |
252 typedef GM INHERITED; | 252 typedef GM INHERITED; |
253 }; | 253 }; |
254 | 254 |
255 ////////////////////////////////////////////////////////////////////////////// | 255 ////////////////////////////////////////////////////////////////////////////// |
256 | 256 |
257 DEF_GM(return new TextBlobLooperGM;) | 257 DEF_GM(return new TextBlobLooperGM;) |
258 } | 258 } |
OLD | NEW |