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

Side by Side Diff: gm/drawlooper.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/drawbitmaprect.cpp ('k') | gm/drawminibitmaprect.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 7
8 #include "gm.h" 8 #include "gm.h"
9 #include "SkBlurMask.h" 9 #include "SkBlurMask.h"
10 #include "SkBlurMaskFilter.h" 10 #include "SkBlurMaskFilter.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 canvas->drawText("Looper", 6, SkIntToScalar(230), SkIntToScalar(100), 49 canvas->drawText("Looper", 6, SkIntToScalar(230), SkIntToScalar(100),
50 paint); 50 paint);
51 } 51 }
52 52
53 private: 53 private:
54 sk_sp<SkDrawLooper> fLooper; 54 sk_sp<SkDrawLooper> fLooper;
55 55
56 void init() { 56 void init() {
57 if (fLooper) return; 57 if (fLooper) return;
58 58
59 static const struct { 59 constexpr struct {
60 SkColor fColor; 60 SkColor fColor;
61 SkPaint::Style fStyle; 61 SkPaint::Style fStyle;
62 SkScalar fWidth; 62 SkScalar fWidth;
63 SkScalar fOffset; 63 SkScalar fOffset;
64 SkScalar fBlur; 64 SkScalar fBlur;
65 } gParams[] = { 65 } gParams[] = {
66 { SK_ColorWHITE, SkPaint::kStroke_Style, SkIntToScalar(1)*3/4, 0, 0 }, 66 { SK_ColorWHITE, SkPaint::kStroke_Style, SkIntToScalar(1)*3/4, 0, 0 },
67 { SK_ColorRED, SkPaint::kStroke_Style, SkIntToScalar(4), 0, 0 }, 67 { SK_ColorRED, SkPaint::kStroke_Style, SkIntToScalar(4), 0, 0 },
68 { SK_ColorBLUE, SkPaint::kFill_Style, 0, 0, 0 }, 68 { SK_ColorBLUE, SkPaint::kFill_Style, 0, 0, 0 },
69 { 0x88000000, SkPaint::kFill_Style, 0, SkIntToScalar(10), SkIntToSca lar(3) } 69 { 0x88000000, SkPaint::kFill_Style, 0, SkIntToScalar(10), SkIntToSca lar(3) }
(...skipping 18 matching lines...) Expand all
88 } 88 }
89 fLooper = looperBuilder.detach(); 89 fLooper = looperBuilder.detach();
90 } 90 }
91 91
92 typedef GM INHERITED; 92 typedef GM INHERITED;
93 }; 93 };
94 94
95 ////////////////////////////////////////////////////////////////////////////// 95 //////////////////////////////////////////////////////////////////////////////
96 96
97 DEF_GM( return new DrawLooperGM; ) 97 DEF_GM( return new DrawLooperGM; )
OLDNEW
« no previous file with comments | « gm/drawbitmaprect.cpp ('k') | gm/drawminibitmaprect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698