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

Unified Diff: gm/drawminibitmaprect.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/drawlooper.cpp ('k') | gm/dstreadshuffle.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/drawminibitmaprect.cpp
diff --git a/gm/drawminibitmaprect.cpp b/gm/drawminibitmaprect.cpp
index d539f2604826577345c32c6b729b8d6295b57b5d..eccf04c352fd9b3304843786cb64a3b933912766 100644
--- a/gm/drawminibitmaprect.cpp
+++ b/gm/drawminibitmaprect.cpp
@@ -29,12 +29,12 @@ static sk_sp<SkImage> makebm(SkCanvas* caller, int w, int h) {
const SkScalar radius = 4 * SkMaxScalar(wScalar, hScalar);
- static const SkColor colors[] = { SK_ColorRED, SK_ColorYELLOW,
+ constexpr SkColor colors[] = { SK_ColorRED, SK_ColorYELLOW,
SK_ColorGREEN, SK_ColorMAGENTA,
SK_ColorBLUE, SK_ColorCYAN,
SK_ColorRED};
- static const SkScalar pos[] = {0,
+ constexpr SkScalar pos[] = {0,
SK_Scalar1 / 6,
2 * SK_Scalar1 / 6,
3 * SK_Scalar1 / 6,
@@ -60,8 +60,8 @@ static sk_sp<SkImage> makebm(SkCanvas* caller, int w, int h) {
return surface->makeImageSnapshot();
}
-static const int gSize = 1024;
-static const int gSurfaceSize = 2048;
+constexpr int gSize = 1024;
+constexpr int gSurfaceSize = 2048;
// This GM calls drawImageRect several times using the same texture. This is
// intended to exercise batching of these calls.
@@ -85,10 +85,10 @@ protected:
}
const SkRect dstRect = { 0, 0, SkIntToScalar(64), SkIntToScalar(64)};
- static const int kMaxSrcRectSize = 1 << (SkNextLog2(gSurfaceSize) + 2);
+ const int kMaxSrcRectSize = 1 << (SkNextLog2(gSurfaceSize) + 2);
- static const int kPadX = 30;
- static const int kPadY = 40;
+ constexpr int kPadX = 30;
+ constexpr int kPadY = 40;
int rowCount = 0;
canvas->translate(SkIntToScalar(kPadX), SkIntToScalar(kPadY));
« no previous file with comments | « gm/drawlooper.cpp ('k') | gm/dstreadshuffle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698