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

Side by Side Diff: gm/pictureshadertile.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/pictureimagegenerator.cpp ('k') | gm/pixelsnap.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 9
10 #include "SkPaint.h" 10 #include "SkPaint.h"
11 #include "SkPicture.h" 11 #include "SkPicture.h"
12 #include "SkPictureRecorder.h" 12 #include "SkPictureRecorder.h"
13 #include "SkShader.h" 13 #include "SkShader.h"
14 14
15 static const SkScalar kPictureSize = SK_Scalar1; 15 constexpr SkScalar kPictureSize = SK_Scalar1;
16 static const SkScalar kFillSize = 100; 16 constexpr SkScalar kFillSize = 100;
17 static const unsigned kRowSize = 6; 17 constexpr unsigned kRowSize = 6;
18 18
19 static const struct { 19 constexpr struct {
20 SkScalar x, y, w, h; 20 SkScalar x, y, w, h;
21 SkScalar offsetX, offsetY; 21 SkScalar offsetX, offsetY;
22 } tiles[] = { 22 } tiles[] = {
23 { 0, 0, 1, 1, 0, 0 }, 23 { 0, 0, 1, 1, 0, 0 },
24 { -0.5f, -0.5f, 1, 1, 0, 0 }, 24 { -0.5f, -0.5f, 1, 1, 0, 0 },
25 { 0.5f, 0.5f, 1, 1, 0, 0 }, 25 { 0.5f, 0.5f, 1, 1, 0, 0 },
26 26
27 { 0, 0, 1.5f, 1.5f, 0, 0 }, 27 { 0, 0, 1.5f, 1.5f, 0, 0 },
28 { -0.5f, -0.5f, 1.5f, 1.5f, 0, 0 }, 28 { -0.5f, -0.5f, 1.5f, 1.5f, 0, 0 },
29 { 0.5f, 0.5f, 1.5f, 1.5f, 0, 0 }, 29 { 0.5f, 0.5f, 1.5f, 1.5f, 0, 0 },
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 } 147 }
148 } 148 }
149 149
150 private: 150 private:
151 sk_sp<SkShader> fShaders[SK_ARRAY_COUNT(tiles)]; 151 sk_sp<SkShader> fShaders[SK_ARRAY_COUNT(tiles)];
152 152
153 typedef GM INHERITED; 153 typedef GM INHERITED;
154 }; 154 };
155 155
156 DEF_GM(return new PictureShaderTileGM;) 156 DEF_GM(return new PictureShaderTileGM;)
OLDNEW
« no previous file with comments | « gm/pictureimagegenerator.cpp ('k') | gm/pixelsnap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698