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

Unified Diff: gm/gradientDirtyLaundry.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/gm.cpp ('k') | gm/gradient_matrix.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/gradientDirtyLaundry.cpp
diff --git a/gm/gradientDirtyLaundry.cpp b/gm/gradientDirtyLaundry.cpp
index 6b16be9f0132c57641d844f7b5f7e016d1f2847a..dc52d9e6551a38fe18f6a6dd78f360adb6617c9b 100644
--- a/gm/gradientDirtyLaundry.cpp
+++ b/gm/gradientDirtyLaundry.cpp
@@ -15,7 +15,7 @@ struct GradData {
const SkScalar* fPos;
};
-static const SkColor gColors[] = {
+constexpr SkColor gColors[] = {
SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorWHITE, SK_ColorBLACK,
SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorWHITE, SK_ColorBLACK,
SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorWHITE, SK_ColorBLACK,
@@ -26,9 +26,9 @@ static const SkColor gColors[] = {
SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorWHITE, SK_ColorBLACK,
};
-//static const SkScalar gPos[] = { SK_Scalar1*999/2000, SK_Scalar1*1001/2000 };
+//constexpr SkScalar gPos[] = { SK_Scalar1*999/2000, SK_Scalar1*1001/2000 };
-static const GradData gGradData[] = {
+constexpr GradData gGradData[] = {
{ 40, gColors, nullptr },
// { 2, gColors, gPos },
// { 2, gCol2, nullptr },
@@ -51,7 +51,7 @@ static sk_sp<SkShader> MakeSweep(const SkPoint pts[2], const GradData& data, SkS
typedef sk_sp<SkShader> (*GradMaker)(const SkPoint pts[2], const GradData&, SkShader::TileMode);
-static const GradMaker gGradMakers[] = {
+constexpr GradMaker gGradMakers[] = {
MakeLinear, MakeRadial, MakeSweep,
};
« no previous file with comments | « gm/gm.cpp ('k') | gm/gradient_matrix.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698