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

Side by Side Diff: gm/complexclip3.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/complexclip2.cpp ('k') | gm/composeshader.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 #include "gm.h" 7 #include "gm.h"
8 #include "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkPath.h" 9 #include "SkPath.h"
10 10
11 namespace skiagm { 11 namespace skiagm {
12 12
13 static const SkColor gPathColor = SK_ColorYELLOW; 13 constexpr SkColor gPathColor = SK_ColorYELLOW;
14 14
15 class ComplexClip3GM : public GM { 15 class ComplexClip3GM : public GM {
16 public: 16 public:
17 ComplexClip3GM(bool doSimpleClipFirst) 17 ComplexClip3GM(bool doSimpleClipFirst)
18 : fDoSimpleClipFirst(doSimpleClipFirst) { 18 : fDoSimpleClipFirst(doSimpleClipFirst) {
19 this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD)); 19 this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
20 } 20 }
21 21
22 protected: 22 protected:
23 23
(...skipping 20 matching lines...) Expand all
44 44
45 if (!fDoSimpleClipFirst) { 45 if (!fDoSimpleClipFirst) {
46 SkTSwap<SkPath*>(firstClip, secondClip); 46 SkTSwap<SkPath*>(firstClip, secondClip);
47 } 47 }
48 48
49 SkPaint paint; 49 SkPaint paint;
50 paint.setAntiAlias(true); 50 paint.setAntiAlias(true);
51 sk_tool_utils::set_portable_typeface(&paint); 51 sk_tool_utils::set_portable_typeface(&paint);
52 paint.setTextSize(SkIntToScalar(20)); 52 paint.setTextSize(SkIntToScalar(20));
53 53
54 static const struct { 54 constexpr struct {
55 SkRegion::Op fOp; 55 SkRegion::Op fOp;
56 const char* fName; 56 const char* fName;
57 } gOps[] = { 57 } gOps[] = {
58 {SkRegion::kIntersect_Op, "I"}, 58 {SkRegion::kIntersect_Op, "I"},
59 {SkRegion::kDifference_Op, "D" }, 59 {SkRegion::kDifference_Op, "D" },
60 {SkRegion::kUnion_Op, "U"}, 60 {SkRegion::kUnion_Op, "U"},
61 {SkRegion::kXOR_Op, "X" }, 61 {SkRegion::kXOR_Op, "X" },
62 {SkRegion::kReverseDifference_Op, "R"} 62 {SkRegion::kReverseDifference_Op, "R"}
63 }; 63 };
64 64
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 typedef GM INHERITED; 123 typedef GM INHERITED;
124 }; 124 };
125 125
126 ////////////////////////////////////////////////////////////////////////////// 126 //////////////////////////////////////////////////////////////////////////////
127 127
128 // Simple clip first 128 // Simple clip first
129 DEF_GM( return new ComplexClip3GM(true); ) 129 DEF_GM( return new ComplexClip3GM(true); )
130 // Complex clip first 130 // Complex clip first
131 DEF_GM( return new ComplexClip3GM(false); ) 131 DEF_GM( return new ComplexClip3GM(false); )
132 } 132 }
OLDNEW
« no previous file with comments | « gm/complexclip2.cpp ('k') | gm/composeshader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698