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

Side by Side Diff: gm/rects.cpp

Issue 1821533002: guard rasterizer and drawlooper setters (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update android sdk 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
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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 SK_ARRAY_COUNT(colors), 84 SK_ARRAY_COUNT(colors),
85 SkShader::kClamp_TileMode)) ; 85 SkShader::kClamp_TileMode)) ;
86 fPaints.push_back(p); 86 fPaints.push_back(p);
87 } 87 }
88 88
89 { 89 {
90 // AA with blur 90 // AA with blur
91 SkPaint p; 91 SkPaint p;
92 p.setColor(SK_ColorWHITE); 92 p.setColor(SK_ColorWHITE);
93 p.setAntiAlias(true); 93 p.setAntiAlias(true);
94 SkDrawLooper* shadowLooper = 94 auto shadowLooper =
95 SkBlurDrawLooper::Create(SK_ColorWHITE, 95 SkBlurDrawLooper::Make(SK_ColorWHITE,
96 SkBlurMask::ConvertRadiusToSigma(SkIntT oScalar(10)), 96 SkBlurMask::ConvertRadiusToSigma(SkIntT oScalar(10)),
97 SkIntToScalar(5), SkIntToScalar(10), 97 SkIntToScalar(5), SkIntToScalar(10),
98 SkBlurDrawLooper::kIgnoreTransform_Blur Flag | 98 SkBlurDrawLooper::kIgnoreTransform_Blur Flag |
99 SkBlurDrawLooper::kOverrideColor_BlurFl ag | 99 SkBlurDrawLooper::kOverrideColor_BlurFl ag |
100 SkBlurDrawLooper::kHighQuality_BlurFlag ); 100 SkBlurDrawLooper::kHighQuality_BlurFlag );
101 SkAutoUnref aurL0(shadowLooper);
102 p.setLooper(shadowLooper); 101 p.setLooper(shadowLooper);
f(malita) 2016/03/21 13:53:43 nit: ditto
reed1 2016/03/21 17:15:23 Done.
103 fPaints.push_back(p); 102 fPaints.push_back(p);
104 } 103 }
105 104
106 { 105 {
107 // AA with stroke style 106 // AA with stroke style
108 SkPaint p; 107 SkPaint p;
109 p.setColor(SK_ColorWHITE); 108 p.setColor(SK_ColorWHITE);
110 p.setAntiAlias(true); 109 p.setAntiAlias(true);
111 p.setStyle(SkPaint::kStroke_Style); 110 p.setStyle(SkPaint::kStroke_Style);
112 p.setStrokeWidth(SkIntToScalar(3)); 111 p.setStrokeWidth(SkIntToScalar(3));
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 282
284 typedef GM INHERITED; 283 typedef GM INHERITED;
285 }; 284 };
286 285
287 ////////////////////////////////////////////////////////////////////////////// 286 //////////////////////////////////////////////////////////////////////////////
288 287
289 static GM* MyFactory(void*) { return new RectsGM; } 288 static GM* MyFactory(void*) { return new RectsGM; }
290 static GMRegistry reg(MyFactory); 289 static GMRegistry reg(MyFactory);
291 290
292 } 291 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698