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

Side by Side Diff: gm/dftext.cpp

Issue 805543002: DM warning-free on win64 (Closed) Base URL: https://skia.googlesource.com/skia.git@w64
Patch Set: Created 6 years 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 | « no previous file | gm/glyph_pos_align.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 #include "gm.h" 7 #include "gm.h"
8 #include "Resources.h" 8 #include "Resources.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkStream.h" 10 #include "SkStream.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 canvas->drawText(text, textLen, 0, 0, paint); 131 canvas->drawText(text, textLen, 0, 0, paint);
132 y += paint.getFontMetrics(NULL)*scaleFactor; 132 y += paint.getFontMetrics(NULL)*scaleFactor;
133 } 133 }
134 134
135 // check pos text 135 // check pos text
136 { 136 {
137 SkAutoCanvasRestore acr(canvas, true); 137 SkAutoCanvasRestore acr(canvas, true);
138 138
139 canvas->scale(2.0f, 2.0f); 139 canvas->scale(2.0f, 2.0f);
140 140
141 SkAutoTArray<SkPoint> pos(textLen); 141 SkAutoTArray<SkPoint> pos(SkToInt(textLen));
142 SkAutoTArray<SkScalar> widths(textLen); 142 SkAutoTArray<SkScalar> widths(SkToInt(textLen));
143 paint.setTextSize(textSizes[0]); 143 paint.setTextSize(textSizes[0]);
144 144
145 paint.getTextWidths(text, textLen, &widths[0]); 145 paint.getTextWidths(text, textLen, &widths[0]);
146 146
147 SkScalar x = SkIntToScalar(340); 147 SkScalar x = SkIntToScalar(340);
148 SkScalar y = SkIntToScalar(75); 148 SkScalar y = SkIntToScalar(75);
149 for (unsigned int i = 0; i < textLen; ++i) { 149 for (unsigned int i = 0; i < textLen; ++i) {
150 pos[i].set(x, y); 150 pos[i].set(x, y);
151 x += widths[i]; 151 x += widths[i];
152 } 152 }
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 #endif 216 #endif
217 } 217 }
218 218
219 private: 219 private:
220 SkTypeface* fTypeface; 220 SkTypeface* fTypeface;
221 221
222 typedef skiagm::GM INHERITED; 222 typedef skiagm::GM INHERITED;
223 }; 223 };
224 224
225 DEF_GM( return SkNEW(DFTextGM); ) 225 DEF_GM( return SkNEW(DFTextGM); )
OLDNEW
« no previous file with comments | « no previous file | gm/glyph_pos_align.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698