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

Side by Side Diff: gm/inversepaths.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/imagetoyuvplanes.cpp ('k') | gm/largeglyphblur.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 "SkPath.h" 10 #include "SkPath.h"
(...skipping 29 matching lines...) Expand all
40 namespace { 40 namespace {
41 struct Style { 41 struct Style {
42 Style(SkPaint::Style paintStyle, sk_sp<SkPathEffect> pe = sk_sp<SkPathEffect >()) 42 Style(SkPaint::Style paintStyle, sk_sp<SkPathEffect> pe = sk_sp<SkPathEffect >())
43 : fPaintStyle(paintStyle) 43 : fPaintStyle(paintStyle)
44 , fPathEffect(std::move(pe)) {} 44 , fPathEffect(std::move(pe)) {}
45 SkPaint::Style fPaintStyle; 45 SkPaint::Style fPaintStyle;
46 sk_sp<SkPathEffect> fPathEffect; 46 sk_sp<SkPathEffect> fPathEffect;
47 }; 47 };
48 48
49 sk_sp<SkPathEffect> make_dash() { 49 sk_sp<SkPathEffect> make_dash() {
50 static constexpr SkScalar kIntervals[] = { 4.f, 3.f }; 50 constexpr SkScalar kIntervals[] = { 4.f, 3.f };
51 return SkDashPathEffect::Make(kIntervals, SK_ARRAY_COUNT(kIntervals), 0); 51 return SkDashPathEffect::Make(kIntervals, SK_ARRAY_COUNT(kIntervals), 0);
52 } 52 }
53 53
54 Style styles[] { 54 Style styles[] {
55 {SkPaint::kStroke_Style}, 55 {SkPaint::kStroke_Style},
56 {SkPaint::kStrokeAndFill_Style}, 56 {SkPaint::kStrokeAndFill_Style},
57 {SkPaint::kFill_Style}, 57 {SkPaint::kFill_Style},
58 {SkPaint::kStroke_Style, make_dash()}, 58 {SkPaint::kStroke_Style, make_dash()},
59 }; 59 };
60 60
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 131
132 canvas->restore(); 132 canvas->restore();
133 canvas->translate(dx, 0); 133 canvas->translate(dx, 0);
134 } 134 }
135 } 135 }
136 canvas->restore(); 136 canvas->restore();
137 canvas->translate(0, dy); 137 canvas->translate(0, dy);
138 } 138 }
139 } 139 }
140 } 140 }
OLDNEW
« no previous file with comments | « gm/imagetoyuvplanes.cpp ('k') | gm/largeglyphblur.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698