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

Side by Side Diff: gm/rects.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/megalooper.cpp ('k') | gm/shadows.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 #include "SkBlurDrawLooper.h" 9 #include "SkBlurDrawLooper.h"
10 #include "SkBlurMask.h" 10 #include "SkBlurMask.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 p.setShader(s)->unref(); 88 p.setShader(s)->unref();
89 fPaints.push_back(p); 89 fPaints.push_back(p);
90 } 90 }
91 91
92 { 92 {
93 // AA with blur 93 // AA with blur
94 SkPaint p; 94 SkPaint p;
95 p.setColor(SK_ColorWHITE); 95 p.setColor(SK_ColorWHITE);
96 p.setAntiAlias(true); 96 p.setAntiAlias(true);
97 SkBlurDrawLooper* shadowLooper = 97 SkBlurDrawLooper* shadowLooper =
98 new SkBlurDrawLooper (SK_ColorWHITE, 98 SkBlurDrawLooper::Create(SK_ColorWHITE,
99 SkBlurMask::ConvertRadiusToSigma(SkIntToSc alar(10)), 99 SkBlurMask::ConvertRadiusToSigma(SkIntT oScalar(10)),
100 SkIntToScalar(5), SkIntToScalar(10), 100 SkIntToScalar(5), SkIntToScalar(10),
101 SkBlurDrawLooper::kIgnoreTransform_BlurFla g | 101 SkBlurDrawLooper::kIgnoreTransform_Blur Flag |
102 SkBlurDrawLooper::kOverrideColor_BlurFlag | 102 SkBlurDrawLooper::kOverrideColor_BlurFl ag |
103 SkBlurDrawLooper::kHighQuality_BlurFlag); 103 SkBlurDrawLooper::kHighQuality_BlurFlag );
104 SkAutoUnref aurL0(shadowLooper); 104 SkAutoUnref aurL0(shadowLooper);
105 p.setLooper(shadowLooper); 105 p.setLooper(shadowLooper);
106 fPaints.push_back(p); 106 fPaints.push_back(p);
107 } 107 }
108 108
109 { 109 {
110 // AA with stroke style 110 // AA with stroke style
111 SkPaint p; 111 SkPaint p;
112 p.setColor(SK_ColorWHITE); 112 p.setColor(SK_ColorWHITE);
113 p.setAntiAlias(true); 113 p.setAntiAlias(true);
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 292
293 typedef GM INHERITED; 293 typedef GM INHERITED;
294 }; 294 };
295 295
296 ////////////////////////////////////////////////////////////////////////////// 296 //////////////////////////////////////////////////////////////////////////////
297 297
298 static GM* MyFactory(void*) { return new RectsGM; } 298 static GM* MyFactory(void*) { return new RectsGM; }
299 static GMRegistry reg(MyFactory); 299 static GMRegistry reg(MyFactory);
300 300
301 } 301 }
OLDNEW
« no previous file with comments | « gm/megalooper.cpp ('k') | gm/shadows.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698