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

Unified Diff: gm/rectangletexture.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/recordopts.cpp ('k') | gm/rrect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/rectangletexture.cpp
diff --git a/gm/rectangletexture.cpp b/gm/rectangletexture.cpp
index 3208c0d3ba15ef2c18aa9bb262686dbcb3172d81..1359d34a691ea734226ff020dd918bdbeb3712b3 100644
--- a/gm/rectangletexture.cpp
+++ b/gm/rectangletexture.cpp
@@ -127,9 +127,9 @@ protected:
return;
}
- static const int kWidth = 50;
- static const int kHeight = 50;
- static const SkScalar kPad = 5.f;
+ constexpr int kWidth = 50;
+ constexpr int kHeight = 50;
+ constexpr SkScalar kPad = 5.f;
SkPMColor pixels[kWidth * kHeight];
this->fillPixels(kWidth, kHeight, pixels);
@@ -138,19 +138,19 @@ protected:
if (!rectImg) {
SkPaint paint;
paint.setAntiAlias(true);
- static const char* kMsg = "Could not create rectangle texture image.";
+ const char* kMsg = "Could not create rectangle texture image.";
canvas->drawText(kMsg, strlen(kMsg), 10, 100, paint);
return;
}
- static const SkFilterQuality kQualities[] = {
+ constexpr SkFilterQuality kQualities[] = {
kNone_SkFilterQuality,
kLow_SkFilterQuality,
kMedium_SkFilterQuality,
kHigh_SkFilterQuality,
};
- static const SkScalar kScales[] = { 1.0f, 1.2f, 0.75f };
+ constexpr SkScalar kScales[] = { 1.0f, 1.2f, 0.75f };
canvas->translate(kPad, kPad);
for (auto s : kScales) {
« no previous file with comments | « gm/recordopts.cpp ('k') | gm/rrect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698