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

Unified Diff: gm/convexpolyclip.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/convex_all_line_paths.cpp ('k') | gm/convexpolyeffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/convexpolyclip.cpp
diff --git a/gm/convexpolyclip.cpp b/gm/convexpolyclip.cpp
index 0c8e291c31115508a27b4ef1c76f8b687de11541..9681faadf3299ab54c92d0b4243cce6487b1584f 100644
--- a/gm/convexpolyclip.cpp
+++ b/gm/convexpolyclip.cpp
@@ -60,7 +60,7 @@ static SkBitmap make_bmp(int w, int h) {
paint.setTextSize(wScalar / 2.2f);
paint.setShader(0);
paint.setColor(sk_tool_utils::color_to_565(SK_ColorLTGRAY));
- static const char kTxt[] = "Skia";
+ constexpr char kTxt[] = "Skia";
SkPoint texPos = { wScalar / 17, hScalar / 2 + paint.getTextSize() / 2.5f };
canvas.drawText(kTxt, SK_ARRAY_COUNT(kTxt)-1, texPos.fX, texPos.fY, paint);
paint.setColor(SK_ColorBLACK);
@@ -103,7 +103,7 @@ protected:
fClips.addToTail()->setPath(tri);
SkPath hexagon;
- static const SkScalar kRadius = 45.f;
+ constexpr SkScalar kRadius = 45.f;
const SkPoint center = { kRadius, kRadius };
for (int i = 0; i < 6; ++i) {
SkScalar angle = 2 * SK_ScalarPI * i / 6;
@@ -139,14 +139,14 @@ protected:
void onDraw(SkCanvas* canvas) override {
SkScalar y = 0;
- static const SkScalar kMargin = 10.f;
+ constexpr SkScalar kMargin = 10.f;
SkPaint bgPaint;
bgPaint.setAlpha(0x15);
SkISize size = canvas->getDeviceSize();
canvas->drawBitmapRect(fBmp, SkRect::MakeIWH(size.fWidth, size.fHeight), &bgPaint);
- static const char kTxt[] = "Clip Me!";
+ constexpr char kTxt[] = "Clip Me!";
SkPaint txtPaint;
txtPaint.setTextSize(23.f);
txtPaint.setAntiAlias(true);
« no previous file with comments | « gm/convex_all_line_paths.cpp ('k') | gm/convexpolyeffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698