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

Side by Side Diff: gm/vertices.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/variedtext.cpp ('k') | gm/verttext.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 2013 Google Inc. 2 * Copyright 2013 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 "SkColorFilter.h" 10 #include "SkColorFilter.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 SkString name("vertices"); 72 SkString name("vertices");
73 return name; 73 return name;
74 } 74 }
75 75
76 SkISize onISize() override { 76 SkISize onISize() override {
77 return SkISize::Make(600, 600); 77 return SkISize::Make(600, 600);
78 } 78 }
79 79
80 void onDraw(SkCanvas* canvas) override { 80 void onDraw(SkCanvas* canvas) override {
81 // start with the center of a 3x3 grid 81 // start with the center of a 3x3 grid
82 static const uint16_t fan[] = { 82 constexpr uint16_t fan[] = {
83 4, 83 4,
84 0, 1, 2, 5, 8, 7, 6, 3, 0 84 0, 1, 2, 5, 8, 7, 6, 3, 0
85 }; 85 };
86 86
87 const struct { 87 const struct {
88 const SkColor* fColors; 88 const SkColor* fColors;
89 const SkPoint* fTexs; 89 const SkPoint* fTexs;
90 const sk_sp<SkShader>& fShader; 90 const sk_sp<SkShader>& fShader;
91 const sk_sp<SkColorFilter>& fColorFilter; 91 const sk_sp<SkColorFilter>& fColorFilter;
92 uint8_t fAlpha; 92 uint8_t fAlpha;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 } 173 }
174 } 174 }
175 175
176 private: 176 private:
177 typedef skiagm::GM INHERITED; 177 typedef skiagm::GM INHERITED;
178 }; 178 };
179 179
180 //////////////////////////////////////////////////////////////////////////////// ///// 180 //////////////////////////////////////////////////////////////////////////////// /////
181 181
182 DEF_GM(return new VerticesGM();) 182 DEF_GM(return new VerticesGM();)
OLDNEW
« no previous file with comments | « gm/variedtext.cpp ('k') | gm/verttext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698