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

Unified Diff: gm/pixelsnap.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/pictureshadertile.cpp ('k') | gm/polygons.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/pixelsnap.cpp
diff --git a/gm/pixelsnap.cpp b/gm/pixelsnap.cpp
index 1711f5e36d950637bd46c50130f9531d70c0f57e..18fb7b2b7522aefe1b39ff3c9f05287340740654 100644
--- a/gm/pixelsnap.cpp
+++ b/gm/pixelsnap.cpp
@@ -17,15 +17,15 @@ public:
protected:
// kTrans should be even or checkboards wont agree in different test cases.
- static const int kTrans = 14;
- static const int kLabelPad = 4;
+ static constexpr int kTrans = 14;
+ static constexpr int kLabelPad = 4;
// The inverse of this value should be a perfect SkScalar.
- static const int kSubPixelSteps = 8;
- static const int kLabelTextSize = 9;
+ static constexpr int kSubPixelSteps = 8;
+ static constexpr int kLabelTextSize = 9;
static_assert(kSubPixelSteps < 99, "label_offset_too_small");
- static const int kLabelOffsetX = 2 * kLabelTextSize + kLabelPad;
- static const int kLabelOffsetY = kLabelTextSize + kLabelPad;
+ static constexpr int kLabelOffsetX = 2 * kLabelTextSize + kLabelPad;
+ static constexpr int kLabelOffsetY = kLabelTextSize + kLabelPad;
SkISize onISize() override {
return SkISize::Make((kSubPixelSteps + 1) * kTrans + kLabelOffsetX + kLabelPad,
« no previous file with comments | « gm/pictureshadertile.cpp ('k') | gm/polygons.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698