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

Side by Side Diff: gm/circles.cpp

Issue 1852113003: switch maskfilters to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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/blurs.cpp ('k') | gm/drawbitmaprect.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 2012 Intel Inc. 2 * Copyright 2012 Intel 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 #include "gm.h" 7 #include "gm.h"
8 #include "SkBlurDrawLooper.h" 8 #include "SkBlurDrawLooper.h"
9 #include "SkBlurMask.h" 9 #include "SkBlurMask.h"
10 #include "SkBlurMaskFilter.h" 10 #include "SkBlurMaskFilter.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 // AA 44 // AA
45 SkPaint p; 45 SkPaint p;
46 p.setAntiAlias(true); 46 p.setAntiAlias(true);
47 fPaints.push_back(p); 47 fPaints.push_back(p);
48 } 48 }
49 49
50 { 50 {
51 // AA with mask filter 51 // AA with mask filter
52 SkPaint p; 52 SkPaint p;
53 p.setAntiAlias(true); 53 p.setAntiAlias(true);
54 SkMaskFilter* mf = SkBlurMaskFilter::Create( 54 p.setMaskFilter(SkBlurMaskFilter::Make(
55 kNormal_SkBlurStyle, 55 kNormal_SkBlurStyle,
56 SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(5) ), 56 SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(5) ),
57 SkBlurMaskFilter::kHighQuality_BlurFlag); 57 SkBlurMaskFilter::kHighQuality_BlurFlag));
58 p.setMaskFilter(mf)->unref();
59 fPaints.push_back(p); 58 fPaints.push_back(p);
60 } 59 }
61 60
62 { 61 {
63 // AA with radial shader 62 // AA with radial shader
64 SkPaint p; 63 SkPaint p;
65 p.setAntiAlias(true); 64 p.setAntiAlias(true);
66 SkPoint center = SkPoint::Make(SkIntToScalar(40), SkIntToScalar(40)); 65 SkPoint center = SkPoint::Make(SkIntToScalar(40), SkIntToScalar(40));
67 SkColor colors[] = { SK_ColorBLUE, SK_ColorRED, SK_ColorGREEN }; 66 SkColor colors[] = { SK_ColorBLUE, SK_ColorRED, SK_ColorGREEN };
68 SkScalar pos[] = { 0, SK_ScalarHalf, SK_Scalar1 }; 67 SkScalar pos[] = { 0, SK_ScalarHalf, SK_Scalar1 };
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 SkTArray<SkPaint> fPaints; 200 SkTArray<SkPaint> fPaints;
202 SkTArray<SkMatrix> fMatrices; 201 SkTArray<SkMatrix> fMatrices;
203 }; 202 };
204 203
205 ////////////////////////////////////////////////////////////////////////////// 204 //////////////////////////////////////////////////////////////////////////////
206 205
207 static GM* MyFactory(void*) { return new CircleGM; } 206 static GM* MyFactory(void*) { return new CircleGM; }
208 static GMRegistry reg(MyFactory); 207 static GMRegistry reg(MyFactory);
209 208
210 } 209 }
OLDNEW
« no previous file with comments | « gm/blurs.cpp ('k') | gm/drawbitmaprect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698