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

Side by Side Diff: samplecode/SampleShaderText.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 | « samplecode/SampleRepeatTile.cpp ('k') | samplecode/SampleShaders.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 2011 Google Inc. 2 * Copyright 2011 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 "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkGradientShader.h" 10 #include "SkGradientShader.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 int fCount; 43 int fCount;
44 const SkColor* fColors; 44 const SkColor* fColors;
45 const SkScalar* fPos; 45 const SkScalar* fPos;
46 }; 46 };
47 47
48 static const SkColor gColors[] = { 48 static const SkColor gColors[] = {
49 SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorWHITE, SK_ColorBLACK 49 SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorWHITE, SK_ColorBLACK
50 }; 50 };
51 51
52 static const GradData gGradData[] = { 52 static const GradData gGradData[] = {
53 { 2, gColors, NULL }, 53 { 2, gColors, nullptr },
54 { 5, gColors, NULL }, 54 { 5, gColors, nullptr },
55 }; 55 };
56 56
57 static SkShader* MakeLinear(const SkPoint pts[2], const GradData& data, SkShader ::TileMode tm) { 57 static SkShader* MakeLinear(const SkPoint pts[2], const GradData& data, SkShader ::TileMode tm) {
58 return SkGradientShader::CreateLinear(pts, data.fColors, data.fPos, data.fCo unt, tm); 58 return SkGradientShader::CreateLinear(pts, data.fColors, data.fPos, data.fCo unt, tm);
59 } 59 }
60 60
61 static SkShader* MakeRadial(const SkPoint pts[2], const GradData& data, SkShader ::TileMode tm) { 61 static SkShader* MakeRadial(const SkPoint pts[2], const GradData& data, SkShader ::TileMode tm) {
62 SkPoint center; 62 SkPoint center;
63 center.set(SkScalarAve(pts[0].fX, pts[1].fX), 63 center.set(SkScalarAve(pts[0].fX, pts[1].fX),
64 SkScalarAve(pts[0].fY, pts[1].fY)); 64 SkScalarAve(pts[0].fY, pts[1].fY));
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 size_t i = 2*s; 175 size_t i = 2*s;
176 canvas->translate(SkIntToScalar((i / testsPerCol) * colWidth), 176 canvas->translate(SkIntToScalar((i / testsPerCol) * colWidth),
177 SkIntToScalar((i % testsPerCol) * rowHeight)); 177 SkIntToScalar((i % testsPerCol) * rowHeight));
178 paint.setShader(shaders[s])->unref(); 178 paint.setShader(shaders[s])->unref();
179 canvas->drawText(text, textLen, 0, textBase, paint); 179 canvas->drawText(text, textLen, 0, textBase, paint);
180 canvas->restore(); 180 canvas->restore();
181 canvas->save(); 181 canvas->save();
182 ++i; 182 ++i;
183 canvas->translate(SkIntToScalar((i / testsPerCol) * colWidth), 183 canvas->translate(SkIntToScalar((i / testsPerCol) * colWidth),
184 SkIntToScalar((i % testsPerCol) * rowHeight)); 184 SkIntToScalar((i % testsPerCol) * rowHeight));
185 canvas->drawTextOnPath(text, textLen, path, NULL, paint); 185 canvas->drawTextOnPath(text, textLen, path, nullptr, paint);
186 canvas->restore(); 186 canvas->restore();
187 } 187 }
188 canvas->restore(); 188 canvas->restore();
189 } 189 }
190 190
191 private: 191 private:
192 typedef SampleView INHERITED; 192 typedef SampleView INHERITED;
193 }; 193 };
194 194
195 /////////////////////////////////////////////////////////////////////////////// 195 ///////////////////////////////////////////////////////////////////////////////
196 196
197 static SkView* MyFactory() { return new ShaderTextView; } 197 static SkView* MyFactory() { return new ShaderTextView; }
198 static SkViewRegister reg(MyFactory); 198 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleRepeatTile.cpp ('k') | samplecode/SampleShaders.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698