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

Side by Side Diff: gm/lighting.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/lcdoverlap.cpp ('k') | gm/lightingshader.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 2012 Google Inc. 2 * Copyright 2012 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 "SkAnimTimer.h" 9 #include "SkAnimTimer.h"
10 #include "SkLightingImageFilter.h" 10 #include "SkLightingImageFilter.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 shin iness, 151 shin iness,
152 inpu t, 152 inpu t,
153 cr)) ; 153 cr)) ;
154 drawClippedBitmap(canvas, paint, 220, y); 154 drawClippedBitmap(canvas, paint, 220, y);
155 155
156 y += 110; 156 y += 110;
157 } 157 }
158 } 158 }
159 159
160 bool onAnimate(const SkAnimTimer& timer) override { 160 bool onAnimate(const SkAnimTimer& timer) override {
161 static const SkScalar kDesiredDurationSecs = 15.0f; 161 constexpr SkScalar kDesiredDurationSecs = 15.0f;
162 162
163 fAzimuth = kStartAzimuth + timer.scaled(360.0f/kDesiredDurationSecs, 360 .0f); 163 fAzimuth = kStartAzimuth + timer.scaled(360.0f/kDesiredDurationSecs, 360 .0f);
164 return true; 164 return true;
165 } 165 }
166 166
167 private: 167 private:
168 static const int kStartAzimuth = 225; 168 static constexpr int kStartAzimuth = 225;
169 169
170 SkBitmap fBitmap; 170 SkBitmap fBitmap;
171 SkScalar fAzimuth; 171 SkScalar fAzimuth;
172 172
173 typedef GM INHERITED; 173 typedef GM INHERITED;
174 }; 174 };
175 175
176 ////////////////////////////////////////////////////////////////////////////// 176 //////////////////////////////////////////////////////////////////////////////
177 177
178 DEF_GM(return new ImageLightingGM;) 178 DEF_GM(return new ImageLightingGM;)
179 } 179 }
OLDNEW
« no previous file with comments | « gm/lcdoverlap.cpp ('k') | gm/lightingshader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698