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

Unified Diff: gm/stringart.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/smallpaths.cpp ('k') | gm/stroke_rect_shader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/stringart.cpp
diff --git a/gm/stringart.cpp b/gm/stringart.cpp
index 1da87578d0da3f3251cee7b2ccc7d8c553411e40..e21e8f2b51db3643843e7656b01e679310e159b6 100644
--- a/gm/stringart.cpp
+++ b/gm/stringart.cpp
@@ -12,10 +12,10 @@
// Reproduces https://code.google.com/p/chromium/issues/detail?id=279014
-static const int kWidth = 440;
-static const int kHeight = 440;
-static const SkScalar kAngle = 0.305f;
-static const int kMaxNumSteps = 140;
+constexpr int kWidth = 440;
+constexpr int kHeight = 440;
+constexpr SkScalar kAngle = 0.305f;
+constexpr int kMaxNumSteps = 140;
// Renders a string art shape.
// The particular shape rendered can be controlled by adjusting kAngle, from 0 to 1
@@ -61,7 +61,7 @@ protected:
}
bool onAnimate(const SkAnimTimer& timer) override {
- static const SkScalar kDesiredDurationSecs = 3.0f;
+ constexpr SkScalar kDesiredDurationSecs = 3.0f;
// Make the animation ping-pong back and forth but start in the fully drawn state
SkScalar fraction = 1.0f - timer.scaled(2.0f/kDesiredDurationSecs, 2.0f);
« no previous file with comments | « gm/smallpaths.cpp ('k') | gm/stroke_rect_shader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698