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

Side by Side Diff: gm/circles.cpp

Issue 1776973003: partial switch over to sp usage of shaders (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: move into lua container 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/bmpfilterqualityrepeat.cpp ('k') | gm/clippedbitmapshaders.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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 fPaints.push_back(p); 60 fPaints.push_back(p);
61 } 61 }
62 62
63 { 63 {
64 // AA with radial shader 64 // AA with radial shader
65 SkPaint p; 65 SkPaint p;
66 p.setAntiAlias(true); 66 p.setAntiAlias(true);
67 SkPoint center = SkPoint::Make(SkIntToScalar(40), SkIntToScalar(40)); 67 SkPoint center = SkPoint::Make(SkIntToScalar(40), SkIntToScalar(40));
68 SkColor colors[] = { SK_ColorBLUE, SK_ColorRED, SK_ColorGREEN }; 68 SkColor colors[] = { SK_ColorBLUE, SK_ColorRED, SK_ColorGREEN };
69 SkScalar pos[] = { 0, SK_ScalarHalf, SK_Scalar1 }; 69 SkScalar pos[] = { 0, SK_ScalarHalf, SK_Scalar1 };
70 SkShader* s = SkGradientShader::CreateRadial(center, 70 p.setShader(SkGradientShader::MakeRadial(center, 20, colors, pos, SK_ARR AY_COUNT(colors),
71 SkIntToScalar(20), 71 SkShader::kClamp_TileMode));
72 colors,
73 pos,
74 SK_ARRAY_COUNT(colors),
75 SkShader::kClamp_TileMode);
76 p.setShader(s)->unref();
77 fPaints.push_back(p); 72 fPaints.push_back(p);
78 } 73 }
79 74
80 { 75 {
81 // AA with blur 76 // AA with blur
82 SkPaint p; 77 SkPaint p;
83 p.setAntiAlias(true); 78 p.setAntiAlias(true);
84 SkDrawLooper* shadowLooper = 79 SkDrawLooper* shadowLooper =
85 SkBlurDrawLooper::Create(SK_ColorBLUE, 80 SkBlurDrawLooper::Create(SK_ColorBLUE,
86 SkBlurMask::ConvertRadiusToSigma(SkIntToSca lar(10)), 81 SkBlurMask::ConvertRadiusToSigma(SkIntToSca lar(10)),
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 SkTArray<SkPaint> fPaints; 205 SkTArray<SkPaint> fPaints;
211 SkTArray<SkMatrix> fMatrices; 206 SkTArray<SkMatrix> fMatrices;
212 }; 207 };
213 208
214 ////////////////////////////////////////////////////////////////////////////// 209 //////////////////////////////////////////////////////////////////////////////
215 210
216 static GM* MyFactory(void*) { return new CircleGM; } 211 static GM* MyFactory(void*) { return new CircleGM; }
217 static GMRegistry reg(MyFactory); 212 static GMRegistry reg(MyFactory);
218 213
219 } 214 }
OLDNEW
« no previous file with comments | « gm/bmpfilterqualityrepeat.cpp ('k') | gm/clippedbitmapshaders.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698