Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2317)

Side by Side Diff: gm/textbloblooper.cpp

Issue 1813553005: switch patheffects over to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: try to fix xpsdevice Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gm/stroketext.cpp ('k') | gm/texteffects.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 SkPathEffect* make_tile_effect() { 69 static sk_sp<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::Create(m, path); 76 return SkPath2DPathEffect::Make(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())->unref(); 80 paint->setPathEffect(make_tile_effect());
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
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 }
OLDNEW
« no previous file with comments | « gm/stroketext.cpp ('k') | gm/texteffects.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698