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

Unified Diff: gm/dcshader.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/dashing.cpp ('k') | gm/degeneratesegments.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/dcshader.cpp
diff --git a/gm/dcshader.cpp b/gm/dcshader.cpp
index e97ab47a5ead25052f0de701aa35e21e1a1742bb..25d114fd1493cee67c2baf411d5d249a8de1423e 100644
--- a/gm/dcshader.cpp
+++ b/gm/dcshader.cpp
@@ -132,7 +132,7 @@ protected:
struct Circle : public Prim {
SkRect draw(SkCanvas* canvas, const SkPaint& paint) override {
- static const SkScalar radius = 25;
+ constexpr SkScalar radius = 25;
canvas->drawCircle(radius, radius, radius, paint);
return SkRect::MakeXYWH(0, 0, 2 * radius, 2 * radius);
}
@@ -195,7 +195,7 @@ protected:
paint.setTextSize(30.f);
this->setFont(&paint);
const char* text = this->text();
- static const SkVector offset = SkVector::Make(10, 10);
+ const SkVector offset = SkVector::Make(10, 10);
canvas->drawText(text, strlen(text), offset.fX, offset.fY, paint);
SkRect bounds;
paint.measureText(text, strlen(text), &bounds);
@@ -245,7 +245,7 @@ protected:
canvas->translate(10, 20);
canvas->save();
SkScalar tx = 0, maxTy = 0;
- static const SkScalar kW = 900;
+ constexpr SkScalar kW = 900;
for (int aa = 0; aa < 2; ++aa) {
for (int i = 0; i < fPrims.count(); ++i) {
« no previous file with comments | « gm/dashing.cpp ('k') | gm/degeneratesegments.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698