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

Side by Side Diff: gm/rects.cpp

Issue 1789633002: more shader-->sp conversions (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } 73 }
74 74
75 { 75 {
76 // AA with radial shader 76 // AA with radial shader
77 SkPaint p; 77 SkPaint p;
78 p.setColor(SK_ColorWHITE); 78 p.setColor(SK_ColorWHITE);
79 p.setAntiAlias(true); 79 p.setAntiAlias(true);
80 SkPoint center = SkPoint::Make(SkIntToScalar(-5), SkIntToScalar(30)) ; 80 SkPoint center = SkPoint::Make(SkIntToScalar(-5), SkIntToScalar(30)) ;
81 SkColor colors[] = { SK_ColorBLUE, SK_ColorRED, SK_ColorGREEN }; 81 SkColor colors[] = { SK_ColorBLUE, SK_ColorRED, SK_ColorGREEN };
82 SkScalar pos[] = { 0, SK_ScalarHalf, SK_Scalar1 }; 82 SkScalar pos[] = { 0, SK_ScalarHalf, SK_Scalar1 };
83 SkShader* s = SkGradientShader::CreateRadial(center, 83 p.setShader(SkGradientShader::MakeRadial(center, 20, colors, pos,
84 SkIntToScalar(20), 84 SK_ARRAY_COUNT(colors),
85 colors, 85 SkShader::kClamp_TileMode)) ;
86 pos,
87 SK_ARRAY_COUNT(colors),
88 SkShader::kClamp_TileMo de);
89 p.setShader(s)->unref();
90 fPaints.push_back(p); 86 fPaints.push_back(p);
91 } 87 }
92 88
93 { 89 {
94 // AA with blur 90 // AA with blur
95 SkPaint p; 91 SkPaint p;
96 p.setColor(SK_ColorWHITE); 92 p.setColor(SK_ColorWHITE);
97 p.setAntiAlias(true); 93 p.setAntiAlias(true);
98 SkDrawLooper* shadowLooper = 94 SkDrawLooper* shadowLooper =
99 SkBlurDrawLooper::Create(SK_ColorWHITE, 95 SkBlurDrawLooper::Create(SK_ColorWHITE,
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 283
288 typedef GM INHERITED; 284 typedef GM INHERITED;
289 }; 285 };
290 286
291 ////////////////////////////////////////////////////////////////////////////// 287 //////////////////////////////////////////////////////////////////////////////
292 288
293 static GM* MyFactory(void*) { return new RectsGM; } 289 static GM* MyFactory(void*) { return new RectsGM; }
294 static GMRegistry reg(MyFactory); 290 static GMRegistry reg(MyFactory);
295 291
296 } 292 }
OLDNEW
« gm/pictureshadertile.cpp ('K') | « gm/rectangletexture.cpp ('k') | gm/roundrects.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698