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

Unified Diff: gm/constcolorprocessor.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/composeshader.cpp ('k') | gm/convex_all_line_paths.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/constcolorprocessor.cpp
diff --git a/gm/constcolorprocessor.cpp b/gm/constcolorprocessor.cpp
index d9b5f6c17e92663b45f1d222e05d074ff56cff47..166014d4c9987ba6e648f7e551a7a5a38c80f8de 100644
--- a/gm/constcolorprocessor.cpp
+++ b/gm/constcolorprocessor.cpp
@@ -57,21 +57,21 @@ protected:
return;
}
- static const GrColor kColors[] = {
+ constexpr GrColor kColors[] = {
0xFFFFFFFF,
0xFFFF00FF,
0x80000000,
0x00000000,
};
- static const SkColor kPaintColors[] = {
+ constexpr SkColor kPaintColors[] = {
0xFFFFFFFF,
0xFFFF0000,
0x80FF0000,
0x00000000,
};
- static const char* kModeStrs[] {
+ const char* kModeStrs[] {
"kIgnore",
"kModulateRGBA",
"kModulateA",
@@ -175,17 +175,14 @@ private:
// Use this as a way of generating and input FP
sk_sp<SkShader> fShader;
- static const SkScalar kPad;
- static const SkScalar kRectSize;
- static const int kWidth = 820;
- static const int kHeight = 500;
+ static constexpr SkScalar kPad = 10.f;
+ static constexpr SkScalar kRectSize = 20.f;
+ static constexpr int kWidth = 820;
+ static constexpr int kHeight = 500;
typedef GM INHERITED;
};
-const SkScalar ConstColorProcessor::kPad = 10.f;
-const SkScalar ConstColorProcessor::kRectSize = 20.f;
-
DEF_GM(return new ConstColorProcessor;)
}
« no previous file with comments | « gm/composeshader.cpp ('k') | gm/convex_all_line_paths.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698