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/rects.cpp

Issue 1790353002: Revert of 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
« no previous file with comments | « gm/rectangletexture.cpp ('k') | gm/roundrects.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 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 p.setShader(SkGradientShader::MakeRadial(center, 20, colors, pos, 83 SkShader* s = SkGradientShader::CreateRadial(center,
84 SK_ARRAY_COUNT(colors), 84 SkIntToScalar(20),
85 SkShader::kClamp_TileMode)) ; 85 colors,
86 pos,
87 SK_ARRAY_COUNT(colors),
88 SkShader::kClamp_TileMo de);
89 p.setShader(s)->unref();
86 fPaints.push_back(p); 90 fPaints.push_back(p);
87 } 91 }
88 92
89 { 93 {
90 // AA with blur 94 // AA with blur
91 SkPaint p; 95 SkPaint p;
92 p.setColor(SK_ColorWHITE); 96 p.setColor(SK_ColorWHITE);
93 p.setAntiAlias(true); 97 p.setAntiAlias(true);
94 SkDrawLooper* shadowLooper = 98 SkDrawLooper* shadowLooper =
95 SkBlurDrawLooper::Create(SK_ColorWHITE, 99 SkBlurDrawLooper::Create(SK_ColorWHITE,
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 287
284 typedef GM INHERITED; 288 typedef GM INHERITED;
285 }; 289 };
286 290
287 ////////////////////////////////////////////////////////////////////////////// 291 //////////////////////////////////////////////////////////////////////////////
288 292
289 static GM* MyFactory(void*) { return new RectsGM; } 293 static GM* MyFactory(void*) { return new RectsGM; }
290 static GMRegistry reg(MyFactory); 294 static GMRegistry reg(MyFactory);
291 295
292 } 296 }
OLDNEW
« no previous file with comments | « gm/rectangletexture.cpp ('k') | gm/roundrects.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698