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

Side by Side Diff: gm/glyph_pos.cpp

Issue 2300623005: Replace a lot of 'static const' with 'constexpr' or 'const'. (Closed)
Patch Set: small msvc concession Created 4 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/gammacolorfilter.cpp ('k') | 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 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 "SkTypeface.h" 10 #include "SkTypeface.h"
11 11
12 /* This test tries to define the effect of using hairline strokes on text. 12 /* This test tries to define the effect of using hairline strokes on text.
13 * Provides non-hairline images for reference and consistency checks. 13 * Provides non-hairline images for reference and consistency checks.
14 * glyph_pos_(h/n)_(s/f/b) 14 * glyph_pos_(h/n)_(s/f/b)
15 * -> test hairline/non-hairline stroke/fill/stroke+fill. 15 * -> test hairline/non-hairline stroke/fill/stroke+fill.
16 */ 16 */
17 static const SkScalar kTextHeight = 14.0f; 17 constexpr SkScalar kTextHeight = 14.0f;
18 static const char kText[] = "Proportional Hamburgefons #% fi"; 18 constexpr char kText[] = "Proportional Hamburgefons #% fi";
19 19
20 static void drawTestCase(SkCanvas* canvas, 20 static void drawTestCase(SkCanvas* canvas,
21 SkScalar textScale, 21 SkScalar textScale,
22 SkScalar strokeWidth, 22 SkScalar strokeWidth,
23 SkPaint::Style strokeStyle); 23 SkPaint::Style strokeStyle);
24 24
25 static void draw_gm(SkCanvas* canvas, 25 static void draw_gm(SkCanvas* canvas,
26 SkScalar strokeWidth, 26 SkScalar strokeWidth,
27 SkPaint::Style strokeStyle) { 27 SkPaint::Style strokeStyle) {
28 // There's a black pixel at 40, 40 for reference. 28 // There's a black pixel at 40, 40 for reference.
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 } 143 }
144 DEF_SIMPLE_GM(glyph_pos_n_s, c, 800, 600) { 144 DEF_SIMPLE_GM(glyph_pos_n_s, c, 800, 600) {
145 draw_gm(c, 1.2f, SkPaint::kStroke_Style); 145 draw_gm(c, 1.2f, SkPaint::kStroke_Style);
146 } 146 }
147 DEF_SIMPLE_GM(glyph_pos_h_f, c, 800, 600) { 147 DEF_SIMPLE_GM(glyph_pos_h_f, c, 800, 600) {
148 draw_gm(c, 0.0f, SkPaint::kFill_Style); 148 draw_gm(c, 0.0f, SkPaint::kFill_Style);
149 } 149 }
150 DEF_SIMPLE_GM(glyph_pos_n_f, c, 800, 600) { 150 DEF_SIMPLE_GM(glyph_pos_n_f, c, 800, 600) {
151 draw_gm(c, 1.2f, SkPaint::kFill_Style); 151 draw_gm(c, 1.2f, SkPaint::kFill_Style);
152 } 152 }
OLDNEW
« no previous file with comments | « gm/gammacolorfilter.cpp ('k') | gm/glyph_pos_align.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698