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

Side by Side Diff: gm/arithmode.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/anisotropic.cpp ('k') | gm/beziereffects.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 "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 virtual SkString onShortName() { 75 virtual SkString onShortName() {
76 return SkString("arithmode"); 76 return SkString("arithmode");
77 } 77 }
78 78
79 virtual SkISize onISize() { return SkISize::Make(640, 572); } 79 virtual SkISize onISize() { return SkISize::Make(640, 572); }
80 80
81 virtual void onDraw(SkCanvas* canvas) { 81 virtual void onDraw(SkCanvas* canvas) {
82 SkBitmap src = make_src(); 82 SkBitmap src = make_src();
83 SkBitmap dst = make_dst(); 83 SkBitmap dst = make_dst();
84 84
85 const SkScalar one = SK_Scalar1; 85 constexpr SkScalar one = SK_Scalar1;
86 static const SkScalar K[] = { 86 constexpr SkScalar K[] = {
87 0, 0, 0, 0, 87 0, 0, 0, 0,
88 0, 0, 0, one, 88 0, 0, 0, one,
89 0, one, 0, 0, 89 0, one, 0, 0,
90 0, 0, one, 0, 90 0, 0, one, 0,
91 0, one, one, 0, 91 0, one, one, 0,
92 0, one, -one, 0, 92 0, one, -one, 0,
93 0, one/2, one/2, 0, 93 0, one/2, one/2, 0,
94 0, one/2, one/2, one/4, 94 0, one/2, one/2, one/4,
95 0, one/2, one/2, -one/4, 95 0, one/2, one/2, -one/4,
96 one/4, one/2, one/2, 0, 96 one/4, one/2, one/2, 0,
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 } 153 }
154 } 154 }
155 155
156 private: 156 private:
157 typedef GM INHERITED; 157 typedef GM INHERITED;
158 }; 158 };
159 159
160 /////////////////////////////////////////////////////////////////////////////// 160 ///////////////////////////////////////////////////////////////////////////////
161 161
162 DEF_GM( return new ArithmodeGM; ) 162 DEF_GM( return new ArithmodeGM; )
OLDNEW
« no previous file with comments | « gm/anisotropic.cpp ('k') | gm/beziereffects.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698