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

Side by Side Diff: gm/circles.cpp

Issue 232913003: Make sure SkDrawLooper objects can only be allocated on the heap. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 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/blurroundrect.cpp ('k') | gm/drawlooper.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 /* 2 /*
3 * Copyright 2012 Intel Inc. 3 * Copyright 2012 Intel Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "gm.h" 8 #include "gm.h"
9 #include "SkBlurDrawLooper.h" 9 #include "SkBlurDrawLooper.h"
10 #include "SkBlurMask.h" 10 #include "SkBlurMask.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 SkShader::kClamp_TileMode); 74 SkShader::kClamp_TileMode);
75 p.setShader(s)->unref(); 75 p.setShader(s)->unref();
76 fPaints.push_back(p); 76 fPaints.push_back(p);
77 } 77 }
78 78
79 { 79 {
80 // AA with blur 80 // AA with blur
81 SkPaint p; 81 SkPaint p;
82 p.setAntiAlias(true); 82 p.setAntiAlias(true);
83 SkBlurDrawLooper* shadowLooper = 83 SkBlurDrawLooper* shadowLooper =
84 new SkBlurDrawLooper (SK_ColorBLUE, 84 SkBlurDrawLooper::Create(SK_ColorBLUE,
85 SkBlurMask::ConvertRadiusToSigma(SkIntToScalar (10)), 85 SkBlurMask::ConvertRadiusToSigma(SkIntToSca lar(10)),
86 SkIntToScalar(5), SkIntToScalar(10), 86 SkIntToScalar(5), SkIntToScalar(10),
87 SkBlurDrawLooper::kIgnoreTransform_BlurFlag | 87 SkBlurDrawLooper::kIgnoreTransform_BlurFlag |
88 SkBlurDrawLooper::kOverrideColor_BlurFlag | 88 SkBlurDrawLooper::kOverrideColor_BlurFlag |
89 SkBlurDrawLooper::kHighQuality_BlurFlag); 89 SkBlurDrawLooper::kHighQuality_BlurFlag);
90 SkAutoUnref aurL0(shadowLooper); 90 SkAutoUnref aurL0(shadowLooper);
91 p.setLooper(shadowLooper); 91 p.setLooper(shadowLooper);
92 fPaints.push_back(p); 92 fPaints.push_back(p);
93 } 93 }
94 94
95 { 95 {
96 // AA with stroke style 96 // AA with stroke style
97 SkPaint p; 97 SkPaint p;
98 p.setAntiAlias(true); 98 p.setAntiAlias(true);
99 p.setStyle(SkPaint::kStroke_Style); 99 p.setStyle(SkPaint::kStroke_Style);
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 SkTArray<SkPaint> fPaints; 198 SkTArray<SkPaint> fPaints;
199 SkTArray<SkMatrix> fMatrices; 199 SkTArray<SkMatrix> fMatrices;
200 }; 200 };
201 201
202 ////////////////////////////////////////////////////////////////////////////// 202 //////////////////////////////////////////////////////////////////////////////
203 203
204 static GM* MyFactory(void*) { return new CircleGM; } 204 static GM* MyFactory(void*) { return new CircleGM; }
205 static GMRegistry reg(MyFactory); 205 static GMRegistry reg(MyFactory);
206 206
207 } 207 }
OLDNEW
« no previous file with comments | « gm/blurroundrect.cpp ('k') | gm/drawlooper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698