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

Unified Diff: gm/gradients_2pt_conical.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/gradients.cpp ('k') | gm/gradients_no_texture.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/gradients_2pt_conical.cpp
diff --git a/gm/gradients_2pt_conical.cpp b/gm/gradients_2pt_conical.cpp
index 28ed8bb965ea6ad4f53a29f9ffb1ef19c035bed2..ee1aee9e2d40c319ed23f5d29f33c287e9e7cca0 100644
--- a/gm/gradients_2pt_conical.cpp
+++ b/gm/gradients_2pt_conical.cpp
@@ -16,21 +16,21 @@ struct GradData {
const SkScalar* fPos;
};
-static const SkColor gColors[] = {
+constexpr SkColor gColors[] = {
SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorWHITE, SK_ColorBLACK
};
-static const SkScalar gPos0[] = { 0, SK_Scalar1 };
-static const SkScalar gPos1[] = { SK_Scalar1/4, SK_Scalar1*3/4 };
-static const SkScalar gPos2[] = {
+constexpr SkScalar gPos0[] = { 0, SK_Scalar1 };
+constexpr SkScalar gPos1[] = { SK_Scalar1/4, SK_Scalar1*3/4 };
+constexpr SkScalar gPos2[] = {
0, SK_Scalar1/8, SK_Scalar1/2, SK_Scalar1*7/8, SK_Scalar1
};
-static const SkScalar gPosClamp[] = {0.0f, 0.0f, 1.0f, 1.0f};
-static const SkColor gColorClamp[] = {
+constexpr SkScalar gPosClamp[] = {0.0f, 0.0f, 1.0f, 1.0f};
+constexpr SkColor gColorClamp[] = {
SK_ColorRED, SK_ColorGREEN, SK_ColorGREEN, SK_ColorBLUE
};
-static const GradData gGradData[] = {
+constexpr GradData gGradData[] = {
{ 2, gColors, gPos0 },
{ 2, gColors, gPos1 },
{ 5, gColors, gPos2 },
@@ -250,17 +250,17 @@ static sk_sp<SkShader> Make2ConicalInsideSmallRad(const SkPoint pts[2], const Gr
typedef sk_sp<SkShader> (*GradMaker)(const SkPoint pts[2], const GradData& data,
SkShader::TileMode tm, const SkMatrix& localMatrix);
-static const GradMaker gGradMakersOutside[] = {
+constexpr GradMaker gGradMakersOutside[] = {
Make2ConicalOutside, Make2ConicalOutsideFlip,
Make2ConicalZeroRadOutside, Make2ConicalZeroRadFlipOutside
};
-static const GradMaker gGradMakersInside[] = {
+constexpr GradMaker gGradMakersInside[] = {
Make2ConicalInside, Make2ConicalInsideFlip, Make2ConicalInsideCenter,
Make2ConicalZeroRad, Make2ConicalZeroRadFlip, Make2ConicalZeroRadCenter,
};
-static const GradMaker gGradMakersEdgeCases[] = {
+constexpr GradMaker gGradMakersEdgeCases[] = {
Make2ConicalEdgeX, Make2ConicalEdgeY,
Make2ConicalZeroRadEdgeX, Make2ConicalZeroRadEdgeY,
Make2ConicalTouchX, Make2ConicalTouchY,
@@ -268,7 +268,7 @@ static const GradMaker gGradMakersEdgeCases[] = {
};
-static const struct {
+constexpr struct {
const GradMaker* fMaker;
const int fCount;
const char* fName;
« no previous file with comments | « gm/gradients.cpp ('k') | gm/gradients_no_texture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698