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

Side by Side Diff: gm/glyph_pos_align.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 | « gm/dftext.cpp ('k') | src/gpu/GrLayerHoister.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 2014 Google Inc. 2 * Copyright 2014 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 "SkGradientShader.h" 10 #include "SkGradientShader.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 drawTestCase(canvas, "Center Align", 4 * kTextHeight, paint); 52 drawTestCase(canvas, "Center Align", 4 * kTextHeight, paint);
53 53
54 paint.setTextAlign(SkPaint::kLeft_Align); 54 paint.setTextAlign(SkPaint::kLeft_Align);
55 drawTestCase(canvas, "Left Align", 7 * kTextHeight, paint); 55 drawTestCase(canvas, "Left Align", 7 * kTextHeight, paint);
56 } 56 }
57 57
58 void drawTestCase(SkCanvas* canvas, const char* text, SkScalar y, const SkPa int& paint) { 58 void drawTestCase(SkCanvas* canvas, const char* text, SkScalar y, const SkPa int& paint) {
59 SkScalar widths[kMaxStringLength]; 59 SkScalar widths[kMaxStringLength];
60 SkScalar posX[kMaxStringLength]; 60 SkScalar posX[kMaxStringLength];
61 SkPoint pos[kMaxStringLength]; 61 SkPoint pos[kMaxStringLength];
62 int length = strlen(text); 62 int length = SkToInt(strlen(text));
63 SkASSERT(length <= kMaxStringLength); 63 SkASSERT(length <= kMaxStringLength);
64 64
65 paint.getTextWidths(text, length, widths); 65 paint.getTextWidths(text, length, widths);
66 66
67 float originX; 67 float originX;
68 switch (paint.getTextAlign()) { 68 switch (paint.getTextAlign()) {
69 case SkPaint::kRight_Align: originX = 1; break; 69 case SkPaint::kRight_Align: originX = 1; break;
70 case SkPaint::kCenter_Align: originX = 0.5f; break; 70 case SkPaint::kCenter_Align: originX = 0.5f; break;
71 case SkPaint::kLeft_Align: originX = 0; break; 71 case SkPaint::kLeft_Align: originX = 0; break;
72 default: SkFAIL("Invalid paint origin"); return; 72 default: SkFAIL("Invalid paint origin"); return;
(...skipping 17 matching lines...) Expand all
90 90
91 ////////////////////////////////////////////////////////////////////////////// 91 //////////////////////////////////////////////////////////////////////////////
92 92
93 static GM* GlyphPosAlignFactory(void*) { 93 static GM* GlyphPosAlignFactory(void*) {
94 return new GlyphPosAlignGM(); 94 return new GlyphPosAlignGM();
95 } 95 }
96 96
97 static GMRegistry reg(GlyphPosAlignFactory); 97 static GMRegistry reg(GlyphPosAlignFactory);
98 98
99 } 99 }
OLDNEW
« no previous file with comments | « gm/dftext.cpp ('k') | src/gpu/GrLayerHoister.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698