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

Side by Side Diff: gm/lcdblendmodes.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/largeglyphblur.cpp ('k') | gm/lcdoverlap.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 2015 Google Inc. 2 * Copyright 2015 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 8
9 /* 9 /*
10 * Tests text rendering with LCD and the various blend modes. 10 * Tests text rendering with LCD and the various blend modes.
11 */ 11 */
12 12
13 #include "gm.h" 13 #include "gm.h"
14 #include "SkCanvas.h" 14 #include "SkCanvas.h"
15 #include "SkGradientShader.h" 15 #include "SkGradientShader.h"
16 #include "SkSurface.h" 16 #include "SkSurface.h"
17 17
18 namespace skiagm { 18 namespace skiagm {
19 19
20 static const int kColWidth = 180; 20 constexpr int kColWidth = 180;
21 static const int kNumCols = 4; 21 constexpr int kNumCols = 4;
22 static const int kWidth = kColWidth * kNumCols; 22 constexpr int kWidth = kColWidth * kNumCols;
23 static const int kHeight = 750; 23 constexpr int kHeight = 750;
24 24
25 static sk_sp<SkShader> make_shader(const SkRect& bounds) { 25 static sk_sp<SkShader> make_shader(const SkRect& bounds) {
26 const SkPoint pts[] = { 26 const SkPoint pts[] = {
27 { bounds.left(), bounds.top() }, 27 { bounds.left(), bounds.top() },
28 { bounds.right(), bounds.bottom() }, 28 { bounds.right(), bounds.bottom() },
29 }; 29 };
30 const SkColor colors[] = { 30 const SkColor colors[] = {
31 SK_ColorRED, SK_ColorGREEN, 31 SK_ColorRED, SK_ColorGREEN,
32 }; 32 };
33 return SkGradientShader::MakeLinear(pts, colors, nullptr, SK_ARRAY_COUNT(col ors), 33 return SkGradientShader::MakeLinear(pts, colors, nullptr, SK_ARRAY_COUNT(col ors),
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 private: 144 private:
145 SkScalar fTextHeight; 145 SkScalar fTextHeight;
146 sk_sp<SkShader> fCheckerboard; 146 sk_sp<SkShader> fCheckerboard;
147 typedef skiagm::GM INHERITED; 147 typedef skiagm::GM INHERITED;
148 }; 148 };
149 149
150 ////////////////////////////////////////////////////////////////////////////// 150 //////////////////////////////////////////////////////////////////////////////
151 151
152 DEF_GM( return new LcdBlendGM; ) 152 DEF_GM( return new LcdBlendGM; )
153 } 153 }
OLDNEW
« no previous file with comments | « gm/largeglyphblur.cpp ('k') | gm/lcdoverlap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698