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

Side by Side Diff: gm/colorcube.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/clippedbitmapshaders.cpp ('k') | gm/coloremoji.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 "SkColorCubeFilter.h" 9 #include "SkColorCubeFilter.h"
10 #include "SkData.h" 10 #include "SkData.h"
11 #include "SkGradientShader.h" 11 #include "SkGradientShader.h"
12 #include "SkTemplates.h" 12 #include "SkTemplates.h"
13 13
14 namespace skiagm { 14 namespace skiagm {
15 15
16 static sk_sp<SkShader> MakeLinear() { 16 static sk_sp<SkShader> MakeLinear() {
17 static const SkPoint pts[2] = { 17 constexpr SkPoint pts[2] = {
18 { 0, 0 }, 18 { 0, 0 },
19 { SkIntToScalar(80), SkIntToScalar(80) } 19 { SkIntToScalar(80), SkIntToScalar(80) }
20 }; 20 };
21 static const SkColor colors[] = { SK_ColorYELLOW, SK_ColorBLUE }; 21 constexpr SkColor colors[] = { SK_ColorYELLOW, SK_ColorBLUE };
22 return SkGradientShader::MakeLinear(pts, colors, nullptr, 2, SkShader::kRepe at_TileMode, 0, 22 return SkGradientShader::MakeLinear(pts, colors, nullptr, 2, SkShader::kRepe at_TileMode, 0,
23 &SkMatrix::I()); 23 &SkMatrix::I());
24 } 24 }
25 25
26 class ColorCubeGM : public GM { 26 class ColorCubeGM : public GM {
27 public: 27 public:
28 ColorCubeGM() : fInitialized(false) { 28 ColorCubeGM() : fInitialized(false) {
29 this->setBGColor(0xFF000000); 29 this->setBGColor(0xFF000000);
30 } 30 }
31 31
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 sk_sp<SkData> f3DLut32; 115 sk_sp<SkData> f3DLut32;
116 sk_sp<SkData> f3DLut64; 116 sk_sp<SkData> f3DLut64;
117 }; 117 };
118 118
119 ////////////////////////////////////////////////////////////////////////////// 119 //////////////////////////////////////////////////////////////////////////////
120 120
121 static GM* MyFactory(void*) { return new ColorCubeGM; } 121 static GM* MyFactory(void*) { return new ColorCubeGM; }
122 static GMRegistry reg(MyFactory); 122 static GMRegistry reg(MyFactory);
123 123
124 } 124 }
OLDNEW
« no previous file with comments | « gm/clippedbitmapshaders.cpp ('k') | gm/coloremoji.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698