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

Side by Side Diff: gm/typeface.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/transparency.cpp ('k') | gm/vertices.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 7
8 #include "gm.h" 8 #include "gm.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkString.h" 10 #include "SkString.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 128
129 void onDraw(SkCanvas* canvas) override { 129 void onDraw(SkCanvas* canvas) override {
130 SkPaint paint; 130 SkPaint paint;
131 paint.setAntiAlias(true); 131 paint.setAntiAlias(true);
132 paint.setTextSize(SkIntToScalar(30)); 132 paint.setTextSize(SkIntToScalar(30));
133 133
134 const char* text = fApplyKerning ? "Type AWAY" : "Hamburgefons"; 134 const char* text = fApplyKerning ? "Type AWAY" : "Hamburgefons";
135 const size_t textLen = strlen(text); 135 const size_t textLen = strlen(text);
136 136
137 SkScalar x = SkIntToScalar(10); 137 SkScalar x = SkIntToScalar(10);
138 SkScalar dy = paint.getFontMetrics(NULL); 138 SkScalar dy = paint.getFontMetrics(nullptr);
139 SkScalar y = dy; 139 SkScalar y = dy;
140 140
141 if (fApplyKerning) { 141 if (fApplyKerning) {
142 paint.setSubpixelText(true); 142 paint.setSubpixelText(true);
143 } else { 143 } else {
144 paint.setLinearText(true); 144 paint.setLinearText(true);
145 } 145 }
146 for (int i = 0; i < gFaceStylesCount; i++) { 146 for (int i = 0; i < gFaceStylesCount; i++) {
147 paint.setTypeface(fFaces[i]); 147 paint.setTypeface(fFaces[i]);
148 canvas->drawText(text, textLen, x, y, paint); 148 canvas->drawText(text, textLen, x, y, paint);
149 if (fApplyKerning) { 149 if (fApplyKerning) {
150 drawKernText(canvas, text, textLen, x + 240, y, paint); 150 drawKernText(canvas, text, textLen, x + 240, y, paint);
151 } 151 }
152 y += dy; 152 y += dy;
153 } 153 }
154 } 154 }
155 155
156 private: 156 private:
157 typedef skiagm::GM INHERITED; 157 typedef skiagm::GM INHERITED;
158 }; 158 };
159 159
160 /////////////////////////////////////////////////////////////////////////////// 160 ///////////////////////////////////////////////////////////////////////////////
161 161
162 DEF_GM( return new TypefaceStylesGM(false); ) 162 DEF_GM( return new TypefaceStylesGM(false); )
163 DEF_GM( return new TypefaceStylesGM(true); ) 163 DEF_GM( return new TypefaceStylesGM(true); )
OLDNEW
« no previous file with comments | « gm/transparency.cpp ('k') | gm/vertices.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698