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

Side by Side Diff: gm/dashcircle.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/cubicpaths.cpp ('k') | gm/dashing.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 2016 Google Inc. 2 * Copyright 2016 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 "SkPath.h" 10 #include "SkPath.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 canvas->drawPath(circle, p); 88 canvas->drawPath(circle, p);
89 canvas->restore(); 89 canvas->restore();
90 canvas->translate(0, radius * 2 + 50); 90 canvas->translate(0, radius * 2 + 50);
91 } 91 }
92 canvas->restore(); 92 canvas->restore();
93 canvas->translate(radius * 2 + 50, 0); 93 canvas->translate(radius * 2 + 50, 0);
94 } 94 }
95 } 95 }
96 96
97 bool onAnimate(const SkAnimTimer& timer) override { 97 bool onAnimate(const SkAnimTimer& timer) override {
98 static const SkScalar kDesiredDurationSecs = 100.0f; 98 constexpr SkScalar kDesiredDurationSecs = 100.0f;
99 99
100 fRotation = timer.scaled(360.0f/kDesiredDurationSecs, 360.0f); 100 fRotation = timer.scaled(360.0f/kDesiredDurationSecs, 360.0f);
101 return true; 101 return true;
102 } 102 }
103 103
104 private: 104 private:
105 SkScalar fRotation; 105 SkScalar fRotation;
106 106
107 typedef GM INHERITED; 107 typedef GM INHERITED;
108 }; 108 };
109 109
110 DEF_GM(return new DashCircleGM; ) 110 DEF_GM(return new DashCircleGM; )
OLDNEW
« no previous file with comments | « gm/cubicpaths.cpp ('k') | gm/dashing.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698