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

Unified Diff: gm/bigblurs.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/beziers.cpp ('k') | gm/bigrrectaaeffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/bigblurs.cpp
diff --git a/gm/bigblurs.cpp b/gm/bigblurs.cpp
index 5c09ab94ef6431ed247049d4b5c6971c3d43fd8d..8cad70d94280a90ca60e413a22ae6ed07d38cc61 100644
--- a/gm/bigblurs.cpp
+++ b/gm/bigblurs.cpp
@@ -32,8 +32,8 @@ protected:
}
void onDraw(SkCanvas* canvas) override {
- static const int kBig = 65536;
- static const SkScalar kSigma = SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(4));
+ constexpr int kBig = 65536;
+ const SkScalar kSigma = SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(4));
const SkRect bigRect = SkRect::MakeWH(SkIntToScalar(kBig), SkIntToScalar(kBig));
SkRect insetRect = bigRect;
@@ -46,8 +46,8 @@ protected:
// The blur extends 3*kSigma out from the big rect.
// Offset the close-up windows so we get the entire blur
- static const SkScalar kLeftTopPad = 3*kSigma; // use on left & up of big rect
- static const SkScalar kRightBotPad = kCloseUpSize-3*kSigma; // use on right and bot sides
+ const SkScalar kLeftTopPad = 3*kSigma; // use on left & up of big rect
+ const SkScalar kRightBotPad = kCloseUpSize-3*kSigma; // use on right and bot sides
// UL hand corners of the rendered closeups
const SkPoint origins[] = {
@@ -103,9 +103,9 @@ protected:
}
private:
- static const int kCloseUpSize = 64;
- static const int kWidth = 5 * kCloseUpSize;
- static const int kHeight = 2 * (kLastEnum_SkBlurStyle + 1) * kCloseUpSize;
+ static constexpr int kCloseUpSize = 64;
+ static constexpr int kWidth = 5 * kCloseUpSize;
+ static constexpr int kHeight = 2 * (kLastEnum_SkBlurStyle + 1) * kCloseUpSize;
typedef GM INHERITED;
};
« no previous file with comments | « gm/beziers.cpp ('k') | gm/bigrrectaaeffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698