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

Unified Diff: gm/drawbitmaprect.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/drawatlascolor.cpp ('k') | gm/drawlooper.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/drawbitmaprect.cpp
diff --git a/gm/drawbitmaprect.cpp b/gm/drawbitmaprect.cpp
index ea9a09fe0a779fea70e9569e01fd52aa57b1b333..3c873e290d6cc5aea4a7290cbc57890507b5d39e 100644
--- a/gm/drawbitmaprect.cpp
+++ b/gm/drawbitmaprect.cpp
@@ -131,8 +131,8 @@ static void imagesubsetproc(SkCanvas* canvas, SkImage* image, const SkBitmap& bm
typedef void DrawRectRectProc(SkCanvas*, SkImage*, const SkBitmap&, const SkIRect&, const SkRect&,
const SkPaint*);
-static const int gSize = 1024;
-static const int gBmpSize = 2048;
+constexpr int gSize = 1024;
+constexpr int gBmpSize = 2048;
class DrawBitmapRectGM : public skiagm::GM {
public:
@@ -163,10 +163,10 @@ protected:
}
SkRect dstRect = { 0, 0, SkIntToScalar(64), SkIntToScalar(64)};
- static const int kMaxSrcRectSize = 1 << (SkNextLog2(gBmpSize) + 2);
+ const int kMaxSrcRectSize = 1 << (SkNextLog2(gBmpSize) + 2);
- static const int kPadX = 30;
- static const int kPadY = 40;
+ const int kPadX = 30;
+ const int kPadY = 40;
SkPaint paint;
paint.setAlpha(0x20);
canvas->drawImageRect(fImage, SkRect::MakeIWH(gSize, gSize), &paint);
« no previous file with comments | « gm/drawatlascolor.cpp ('k') | gm/drawlooper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698