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

Unified Diff: gm/blurcircles2.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/blurcircles.cpp ('k') | gm/blurquickreject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/blurcircles2.cpp
diff --git a/gm/blurcircles2.cpp b/gm/blurcircles2.cpp
index ad0c37dc4b994b60e2c6f105864f236add5dedcc..93fcddb0f5f9caa47121ef44aa25ea2489c2e9d9 100644
--- a/gm/blurcircles2.cpp
+++ b/gm/blurcircles2.cpp
@@ -44,7 +44,7 @@ protected:
}
void onDraw(SkCanvas* canvas) override {
- static constexpr SkScalar kMaxR = kMaxRadius + kMaxBlurRadius;
+ constexpr SkScalar kMaxR = kMaxRadius + kMaxBlurRadius;
auto almostCircleMaker = [] (SkScalar radius, SkPath* dst) {
dst->reset();
@@ -76,13 +76,13 @@ protected:
} else {
bool benchMode = this->getMode() == kBench_Mode;
canvas->save();
- static constexpr SkScalar kPad = 5;
- static constexpr SkScalar kRadiusSteps = 5;
- static constexpr SkScalar kBlurRadiusSteps = 5;
+ constexpr SkScalar kPad = 5;
+ constexpr SkScalar kRadiusSteps = 5;
+ constexpr SkScalar kBlurRadiusSteps = 5;
canvas->translate(kPad + kMinRadius + kMaxBlurRadius,
kPad + kMinRadius + kMaxBlurRadius);
- static constexpr SkScalar kDeltaRadius = (kMaxRadius - kMinRadius) / kRadiusSteps;
- static constexpr SkScalar kDeltaBlurRadius = (kMaxBlurRadius - kMinBlurRadius) /
+ constexpr SkScalar kDeltaRadius = (kMaxRadius - kMinRadius) / kRadiusSteps;
+ constexpr SkScalar kDeltaBlurRadius = (kMaxBlurRadius - kMinBlurRadius) /
kBlurRadiusSteps;
SkScalar lineWidth = 0;
if (!benchMode) {
« no previous file with comments | « gm/blurcircles.cpp ('k') | gm/blurquickreject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698