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

Side by Side Diff: samplecode/SampleText.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/SampleSubpixelTranslate.cpp ('k') | samplecode/SampleTextAlpha.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 "SkView.h" 9 #include "SkView.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 static void fill_pts(SkPoint pts[], size_t n, SkRandom* rand) { 141 static void fill_pts(SkPoint pts[], size_t n, SkRandom* rand) {
142 for (size_t i = 0; i < n; i++) 142 for (size_t i = 0; i < n; i++)
143 pts[i].set(rand->nextUScalar1() * 640, rand->nextUScalar1() * 480); 143 pts[i].set(rand->nextUScalar1() * 640, rand->nextUScalar1() * 480);
144 } 144 }
145 145
146 void onDrawContent(SkCanvas* canvas) override { 146 void onDrawContent(SkCanvas* canvas) override {
147 SkAutoCanvasRestore restore(canvas, false); 147 SkAutoCanvasRestore restore(canvas, false);
148 { 148 {
149 SkRect r; 149 SkRect r;
150 r.set(0, 0, SkIntToScalar(1000), SkIntToScalar(20)); 150 r.set(0, 0, SkIntToScalar(1000), SkIntToScalar(20));
151 // canvas->saveLayer(&r, NULL, SkCanvas::kHasAlphaLayer_SaveFlag); 151 // canvas->saveLayer(&r, nullptr, SkCanvas::kHasAlphaLayer_SaveFlag);
152 } 152 }
153 153
154 SkPaint paint; 154 SkPaint paint;
155 // const uint16_t glyphs[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,1 7,18,19 }; 155 // const uint16_t glyphs[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,1 7,18,19 };
156 int index = fHints % SK_ARRAY_COUNT(gHints); 156 int index = fHints % SK_ARRAY_COUNT(gHints);
157 index = 1; 157 index = 1;
158 // const char* style = gHints[index].fName; 158 // const char* style = gHints[index].fName;
159 159
160 // canvas->translate(0, SkIntToScalar(50)); 160 // canvas->translate(0, SkIntToScalar(50));
161 161
(...skipping 19 matching lines...) Expand all
181 } 181 }
182 } 182 }
183 if (gHints[index].fFlushCache) { 183 if (gHints[index].fFlushCache) {
184 // SkGraphics::SetFontCacheUsed(0); 184 // SkGraphics::SetFontCacheUsed(0);
185 } 185 }
186 } 186 }
187 187
188 virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, 188 virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y,
189 unsigned modi) override { 189 unsigned modi) override {
190 fClickX = x; 190 fClickX = x;
191 this->inval(NULL); 191 this->inval(nullptr);
192 return this->INHERITED::onFindClickHandler(x, y, modi); 192 return this->INHERITED::onFindClickHandler(x, y, modi);
193 } 193 }
194 194
195 bool onClick(Click* click) override { 195 bool onClick(Click* click) override {
196 return this->INHERITED::onClick(click); 196 return this->INHERITED::onClick(click);
197 } 197 }
198 198
199 private: 199 private:
200 int fHints; 200 int fHints;
201 SkScalar fClickX; 201 SkScalar fClickX;
202 202
203 typedef SampleView INHERITED; 203 typedef SampleView INHERITED;
204 }; 204 };
205 205
206 ////////////////////////////////////////////////////////////////////////////// 206 //////////////////////////////////////////////////////////////////////////////
207 207
208 static SkView* MyFactory() { return new TextSpeedView; } 208 static SkView* MyFactory() { return new TextSpeedView; }
209 static SkViewRegister reg(MyFactory); 209 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleSubpixelTranslate.cpp ('k') | samplecode/SampleTextAlpha.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698