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

Side by Side Diff: gm/complexclip.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/coloremoji.cpp ('k') | gm/complexclip2.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 2011 Google Inc. 2 * Copyright 2011 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 "SkCanvas.h" 8 #include "SkCanvas.h"
9 //#include "SkParsePath.h" 9 //#include "SkParsePath.h"
10 #include "SkPath.h" 10 #include "SkPath.h"
11 //#include "SkRandom.h" 11 //#include "SkRandom.h"
12 12
13 namespace skiagm { 13 namespace skiagm {
14 14
15 static const SkColor gPathColor = SK_ColorBLACK; 15 constexpr SkColor gPathColor = SK_ColorBLACK;
16 static const SkColor gClipAColor = SK_ColorBLUE; 16 constexpr SkColor gClipAColor = SK_ColorBLUE;
17 static const SkColor gClipBColor = SK_ColorRED; 17 constexpr SkColor gClipBColor = SK_ColorRED;
18 18
19 class ComplexClipGM : public GM { 19 class ComplexClipGM : public GM {
20 public: 20 public:
21 ComplexClipGM(bool aaclip, bool saveLayer, bool invertDraw) 21 ComplexClipGM(bool aaclip, bool saveLayer, bool invertDraw)
22 : fDoAAClip(aaclip) 22 : fDoAAClip(aaclip)
23 , fDoSaveLayer(saveLayer) 23 , fDoSaveLayer(saveLayer)
24 , fInvertDraw(invertDraw) { 24 , fInvertDraw(invertDraw) {
25 this->setBGColor(0xFFDEDFDE); 25 this->setBGColor(0xFFDEDFDE);
26 } 26 }
27 27
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 clipB.lineTo(SkIntToScalar(195), SkIntToScalar(190)); 78 clipB.lineTo(SkIntToScalar(195), SkIntToScalar(190));
79 clipB.lineTo(SkIntToScalar(40), SkIntToScalar(185)); 79 clipB.lineTo(SkIntToScalar(40), SkIntToScalar(185));
80 clipB.lineTo(SkIntToScalar(155), SkIntToScalar(100)); 80 clipB.lineTo(SkIntToScalar(155), SkIntToScalar(100));
81 clipB.close(); 81 clipB.close();
82 82
83 SkPaint paint; 83 SkPaint paint;
84 paint.setAntiAlias(true); 84 paint.setAntiAlias(true);
85 sk_tool_utils::set_portable_typeface(&paint); 85 sk_tool_utils::set_portable_typeface(&paint);
86 paint.setTextSize(SkIntToScalar(20)); 86 paint.setTextSize(SkIntToScalar(20));
87 87
88 static const struct { 88 constexpr struct {
89 SkRegion::Op fOp; 89 SkRegion::Op fOp;
90 const char* fName; 90 const char* fName;
91 } gOps[] = { //extra spaces in names for measureText 91 } gOps[] = { //extra spaces in names for measureText
92 {SkRegion::kIntersect_Op, "Isect "}, 92 {SkRegion::kIntersect_Op, "Isect "},
93 {SkRegion::kDifference_Op, "Diff " }, 93 {SkRegion::kDifference_Op, "Diff " },
94 {SkRegion::kUnion_Op, "Union "}, 94 {SkRegion::kUnion_Op, "Union "},
95 {SkRegion::kXOR_Op, "Xor " }, 95 {SkRegion::kXOR_Op, "Xor " },
96 {SkRegion::kReverseDifference_Op, "RDiff "} 96 {SkRegion::kReverseDifference_Op, "RDiff "}
97 }; 97 };
98 98
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 201
202 DEF_GM(return new ComplexClipGM(false, false, false);) 202 DEF_GM(return new ComplexClipGM(false, false, false);)
203 DEF_GM(return new ComplexClipGM(false, false, true);) 203 DEF_GM(return new ComplexClipGM(false, false, true);)
204 DEF_GM(return new ComplexClipGM(false, true, false);) 204 DEF_GM(return new ComplexClipGM(false, true, false);)
205 DEF_GM(return new ComplexClipGM(false, true, true);) 205 DEF_GM(return new ComplexClipGM(false, true, true);)
206 DEF_GM(return new ComplexClipGM(true, false, false);) 206 DEF_GM(return new ComplexClipGM(true, false, false);)
207 DEF_GM(return new ComplexClipGM(true, false, true);) 207 DEF_GM(return new ComplexClipGM(true, false, true);)
208 DEF_GM(return new ComplexClipGM(true, true, false);) 208 DEF_GM(return new ComplexClipGM(true, true, false);)
209 DEF_GM(return new ComplexClipGM(true, true, true);) 209 DEF_GM(return new ComplexClipGM(true, true, true);)
210 } 210 }
OLDNEW
« no previous file with comments | « gm/coloremoji.cpp ('k') | gm/complexclip2.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698