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

Unified Diff: gm/modecolorfilters.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/mixedtextblobs.cpp ('k') | gm/multipicturedraw.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/modecolorfilters.cpp
diff --git a/gm/modecolorfilters.cpp b/gm/modecolorfilters.cpp
index 4e5d45cf96e5045ee6de71db739c2fc32927d4e7..50bb27f9d8a561db3691e755dd70356660575b17 100644
--- a/gm/modecolorfilters.cpp
+++ b/gm/modecolorfilters.cpp
@@ -16,7 +16,7 @@ namespace skiagm {
// Using gradients because GPU doesn't currently have an implementation of SkColorShader (duh!)
static sk_sp<SkShader> make_color_shader(SkColor color) {
- static const SkPoint kPts[] = {{0, 0}, {1, 1}};
+ constexpr SkPoint kPts[] = {{0, 0}, {1, 1}};
SkColor colors[] = {color, color};
return SkGradientShader::MakeLinear(kPts, colors, nullptr, 2, SkShader::kClamp_TileMode);
@@ -68,10 +68,10 @@ protected:
void onDraw(SkCanvas* canvas) override {
// size of rect for each test case
- static const int kRectWidth = 20;
- static const int kRectHeight = 20;
+ constexpr int kRectWidth = 20;
+ constexpr int kRectHeight = 20;
- static const int kCheckSize = 10;
+ constexpr int kCheckSize = 10;
if (!fBmpShader) {
fBmpShader = make_bg_shader(kCheckSize);
@@ -118,7 +118,7 @@ protected:
SkPaint paint;
int idx = 0;
- static const int kRectsPerRow = SkMax32(this->getISize().fWidth / kRectWidth, 1);
+ const int kRectsPerRow = SkMax32(this->getISize().fWidth / kRectWidth, 1);
for (size_t cfm = 0; cfm < SK_ARRAY_COUNT(modes); ++cfm) {
for (size_t cfc = 0; cfc < SK_ARRAY_COUNT(colors); ++cfc) {
paint.setColorFilter(SkColorFilter::MakeModeFilter(colors[cfc], modes[cfm]));
« no previous file with comments | « gm/mixedtextblobs.cpp ('k') | gm/multipicturedraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698