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

Unified Diff: gm/perspshaders.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/pathfill.cpp ('k') | gm/pictureimagegenerator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/perspshaders.cpp
diff --git a/gm/perspshaders.cpp b/gm/perspshaders.cpp
index 2b09cc64e0ed95a4df2883e2139abcfedbbb2376..b231291c65f3862e7056fdb2f660d96d9bf2f2b0 100644
--- a/gm/perspshaders.cpp
+++ b/gm/perspshaders.cpp
@@ -56,10 +56,10 @@ protected:
{ 0, 0 },
{ 0, SkIntToScalar(kCellSize) }
};
- static const SkColor colors[] = {
+ constexpr SkColor colors[] = {
SK_ColorRED, SK_ColorGREEN, SK_ColorRED, SK_ColorGREEN, SK_ColorRED
};
- static const SkScalar pos[] = { 0, 0.25f, 0.5f, 0.75f, SK_Scalar1 };
+ constexpr SkScalar pos[] = { 0, 0.25f, 0.5f, 0.75f, SK_Scalar1 };
fLinearGrad1 = SkGradientShader::MakeLinear(pts1, colors, pos, SK_ARRAY_COUNT(colors),
SkShader::kClamp_TileMode);
@@ -151,9 +151,9 @@ protected:
canvas->translate(0, SkIntToScalar(kCellSize));
}
private:
- static const int kCellSize = 50;
- static const int kNumRows = 4;
- static const int kNumCols = 6;
+ static constexpr int kCellSize = 50;
+ static constexpr int kNumRows = 4;
+ static constexpr int kNumCols = 6;
bool fDoAA;
SkPath fPath;
« no previous file with comments | « gm/pathfill.cpp ('k') | gm/pictureimagegenerator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698