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

Side by Side Diff: gm/dstreadshuffle.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/drawminibitmaprect.cpp ('k') | gm/emptypath.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 #include "gm.h" 7 #include "gm.h"
8 #include "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkPath.h" 9 #include "SkPath.h"
10 #include "SkRandom.h" 10 #include "SkRandom.h"
(...skipping 26 matching lines...) Expand all
37 return SkString("dstreadshuffle"); 37 return SkString("dstreadshuffle");
38 } 38 }
39 39
40 SkISize onISize() override { 40 SkISize onISize() override {
41 return SkISize::Make(kWidth, kHeight); 41 return SkISize::Make(kWidth, kHeight);
42 } 42 }
43 43
44 void drawShape(SkCanvas* canvas, 44 void drawShape(SkCanvas* canvas,
45 SkPaint* paint, 45 SkPaint* paint,
46 ShapeType type) { 46 ShapeType type) {
47 static const SkRect kRect = SkRect::MakeXYWH(SkIntToScalar(-50), SkIntTo Scalar(-50), 47 const SkRect kRect = SkRect::MakeXYWH(SkIntToScalar(-50), SkIntToScalar( -50),
48 SkIntToScalar(75), SkIntToS calar(105)); 48 SkIntToScalar(75), SkIntToScalar(1 05));
49 switch (type) { 49 switch (type) {
50 case kCircle_ShapeType: 50 case kCircle_ShapeType:
51 canvas->drawCircle(0, 0, 50, *paint); 51 canvas->drawCircle(0, 0, 50, *paint);
52 break; 52 break;
53 case kRoundRect_ShapeType: 53 case kRoundRect_ShapeType:
54 canvas->drawRoundRect(kRect, SkIntToScalar(10), SkIntToScalar(20 ), *paint); 54 canvas->drawRoundRect(kRect, SkIntToScalar(10), SkIntToScalar(20 ), *paint);
55 break; 55 break;
56 case kRect_ShapeType: 56 case kRect_ShapeType:
57 canvas->drawRect(kRect, *paint); 57 canvas->drawRect(kRect, *paint);
58 break; 58 break;
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 } 176 }
177 } 177 }
178 178
179 private: 179 private:
180 enum { 180 enum {
181 kNumShapes = 100, 181 kNumShapes = 100,
182 }; 182 };
183 SkAutoTUnref<SkShader> fBG; 183 SkAutoTUnref<SkShader> fBG;
184 SkPath fConcavePath; 184 SkPath fConcavePath;
185 SkPath fConvexPath; 185 SkPath fConvexPath;
186 static const int kWidth = 900; 186 static constexpr int kWidth = 900;
187 static const int kHeight = 400; 187 static constexpr int kHeight = 400;
188 typedef GM INHERITED; 188 typedef GM INHERITED;
189 }; 189 };
190 190
191 ////////////////////////////////////////////////////////////////////////////// 191 //////////////////////////////////////////////////////////////////////////////
192 192
193 static GM* MyFactory(void*) { return new DstReadShuffle; } 193 static GM* MyFactory(void*) { return new DstReadShuffle; }
194 static GMRegistry reg(MyFactory); 194 static GMRegistry reg(MyFactory);
195 195
196 } 196 }
OLDNEW
« no previous file with comments | « gm/drawminibitmaprect.cpp ('k') | gm/emptypath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698