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

Side by Side Diff: gm/rrect.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/rectangletexture.cpp ('k') | gm/rrectclipdrawpaint.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 2012 Google Inc. 2 * Copyright 2012 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 "SkRRect.h" 10 #include "SkRRect.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 129
130 SkString onShortName() override { 130 SkString onShortName() override {
131 return SkString("rrect"); 131 return SkString("rrect");
132 } 132 }
133 133
134 SkISize onISize() override { 134 SkISize onISize() override {
135 return SkISize::Make(820, 710); 135 return SkISize::Make(820, 710);
136 } 136 }
137 137
138 void onDraw(SkCanvas* canvas) override { 138 void onDraw(SkCanvas* canvas) override {
139 static const InsetProc insetProcs[] = { 139 constexpr InsetProc insetProcs[] = {
140 inset0, inset1, inset2, inset3 140 inset0, inset1, inset2, inset3
141 }; 141 };
142 142
143 SkRRect rrect[4]; 143 SkRRect rrect[4];
144 SkRect r = { 0, 0, 120, 100 }; 144 SkRect r = { 0, 0, 120, 100 };
145 SkVector radii[4] = { 145 SkVector radii[4] = {
146 { 0, 0 }, { 30, 1 }, { 10, 40 }, { 40, 40 } 146 { 0, 0 }, { 30, 1 }, { 10, 40 }, { 40, 40 }
147 }; 147 };
148 148
149 rrect[0].setRect(r); 149 rrect[0].setRect(r);
(...skipping 11 matching lines...) Expand all
161 canvas->restore(); 161 canvas->restore();
162 canvas->translate(0, 170); 162 canvas->translate(0, 170);
163 } 163 }
164 } 164 }
165 165
166 private: 166 private:
167 typedef GM INHERITED; 167 typedef GM INHERITED;
168 }; 168 };
169 169
170 DEF_GM( return new RRectGM; ) 170 DEF_GM( return new RRectGM; )
OLDNEW
« no previous file with comments | « gm/rectangletexture.cpp ('k') | gm/rrectclipdrawpaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698