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

Side by Side Diff: gm/shaderbounds.cpp

Issue 1316233002: Style Change: NULL->nullptr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-27 (Thursday) 10:25:06 EDT Created 5 years, 3 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/samplerstress.cpp ('k') | gm/shadertext.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 2012 Google Inc. 2 * Copyright 2012 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 #include "gm.h" 7 #include "gm.h"
8 #include "SkGradientShader.h" 8 #include "SkGradientShader.h"
9 9
10 namespace skiagm { 10 namespace skiagm {
11 11
12 static SkShader* MakeLinear(SkScalar width, SkScalar height, bool alternate, 12 static SkShader* MakeLinear(SkScalar width, SkScalar height, bool alternate,
13 const SkMatrix& localMatrix) { 13 const SkMatrix& localMatrix) {
14 SkPoint pts[2] = { {0, 0}, {width, height}}; 14 SkPoint pts[2] = { {0, 0}, {width, height}};
15 SkColor colors[2] = {SK_ColorRED, SK_ColorGREEN}; 15 SkColor colors[2] = {SK_ColorRED, SK_ColorGREEN};
16 if (alternate) { 16 if (alternate) {
17 pts[1].fY = 0; 17 pts[1].fY = 0;
18 colors[0] = SK_ColorBLUE; 18 colors[0] = SK_ColorBLUE;
19 colors[1] = SK_ColorYELLOW; 19 colors[1] = SK_ColorYELLOW;
20 } 20 }
21 return SkGradientShader::CreateLinear(pts, colors, NULL, 2, 21 return SkGradientShader::CreateLinear(pts, colors, nullptr, 2,
22 SkShader::kClamp_TileMode, 0, &localMatr ix); 22 SkShader::kClamp_TileMode, 0, &localMatr ix);
23 } 23 }
24 24
25 /////////////////////////////////////////////////////////////////////////////// 25 ///////////////////////////////////////////////////////////////////////////////
26 26
27 class ShaderBoundsGM : public GM { 27 class ShaderBoundsGM : public GM {
28 public: 28 public:
29 typedef SkShader* (*ShaderGenFunc)(SkScalar width, SkScalar height, 29 typedef SkShader* (*ShaderGenFunc)(SkScalar width, SkScalar height,
30 bool alternate, const SkMatrix& localMatr ix); 30 bool alternate, const SkMatrix& localMatr ix);
31 ShaderBoundsGM(ShaderGenFunc maker, const SkString& name) 31 ShaderBoundsGM(ShaderGenFunc maker, const SkString& name)
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 }; 97 };
98 98
99 /////////////////////////////////////////////////////////////////////////////// 99 ///////////////////////////////////////////////////////////////////////////////
100 100
101 static GM* MyFactory(void*) { 101 static GM* MyFactory(void*) {
102 return new ShaderBoundsGM(MakeLinear, SkString("shaderbounds_linear")); 102 return new ShaderBoundsGM(MakeLinear, SkString("shaderbounds_linear"));
103 } 103 }
104 static GMRegistry reg(MyFactory); 104 static GMRegistry reg(MyFactory);
105 105
106 } 106 }
OLDNEW
« no previous file with comments | « gm/samplerstress.cpp ('k') | gm/shadertext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698