Index: gm/gradient_matrix.cpp |
diff --git a/gm/gradient_matrix.cpp b/gm/gradient_matrix.cpp |
index 816891847ddf4a521898028a27b89c9349bc74a3..3992a49d44f9c037a593c518b08727ef85ba8700 100644 |
--- a/gm/gradient_matrix.cpp |
+++ b/gm/gradient_matrix.cpp |
@@ -19,19 +19,19 @@ |
#include "gm.h" |
-static const SkColor gColors[] = { |
+constexpr SkColor gColors[] = { |
SK_ColorRED, SK_ColorYELLOW |
}; |
// These annoying defines are necessary, because the only other alternative |
// is to use SkIntToScalar(...) everywhere. |
-static const SkScalar sZero = 0; |
-static const SkScalar sHalf = SK_ScalarHalf; |
-static const SkScalar sOne = SK_Scalar1; |
+constexpr SkScalar sZero = 0; |
+constexpr SkScalar sHalf = SK_ScalarHalf; |
+constexpr SkScalar sOne = SK_Scalar1; |
// These arrays define the gradient stop points |
// as x1, y1, x2, y2 per gradient to draw. |
-static const SkPoint linearPts[][2] = { |
+constexpr SkPoint linearPts[][2] = { |
{{sZero, sZero}, {sOne, sZero}}, |
{{sZero, sZero}, {sZero, sOne}}, |
{{sOne, sZero}, {sZero, sZero}}, |
@@ -43,7 +43,7 @@ static const SkPoint linearPts[][2] = { |
{{sZero, sOne}, {sOne, sZero}} |
}; |
-static const SkPoint radialPts[][2] = { |
+constexpr SkPoint radialPts[][2] = { |
{{sZero, sHalf}, {sOne, sHalf}}, |
{{sHalf, sZero}, {sHalf, sOne}}, |
{{sOne, sHalf}, {sZero, sHalf}}, |
@@ -56,10 +56,10 @@ static const SkPoint radialPts[][2] = { |
}; |
// These define the pixels allocated to each gradient image. |
-static const SkScalar TESTGRID_X = SkIntToScalar(200); |
-static const SkScalar TESTGRID_Y = SkIntToScalar(200); |
+constexpr SkScalar TESTGRID_X = SkIntToScalar(200); |
+constexpr SkScalar TESTGRID_Y = SkIntToScalar(200); |
-static const int IMAGES_X = 4; // number of images per row |
+constexpr int IMAGES_X = 4; // number of images per row |
static sk_sp<SkShader> make_linear_gradient(const SkPoint pts[2], const SkMatrix& localMatrix) { |
return SkGradientShader::MakeLinear(pts, gColors, nullptr, SK_ARRAY_COUNT(gColors), |