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

Unified Diff: gm/typeface.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/tilemodes_scaled.cpp ('k') | gm/variedtext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/typeface.cpp
diff --git a/gm/typeface.cpp b/gm/typeface.cpp
index d22a276862a076c4b8ee28572ac05e2aea4fe837..8303b373582ec7d1bc9b7a31116ee7fdff742141 100644
--- a/gm/typeface.cpp
+++ b/gm/typeface.cpp
@@ -71,7 +71,7 @@ static void drawKernText(SkCanvas* canvas, const void* text, size_t len,
canvas->drawPosText(glyphs, glyphCount * sizeof(uint16_t), pos, glyphPaint);
}
-static const struct {
+constexpr struct {
const char* fName;
SkTypeface::Style fStyle;
} gFaceStyles[] = {
@@ -89,7 +89,7 @@ static const struct {
{ "monospace", SkTypeface::kBoldItalic },
};
-static const int gFaceStylesCount = SK_ARRAY_COUNT(gFaceStyles);
+constexpr int gFaceStylesCount = SK_ARRAY_COUNT(gFaceStyles);
class TypefaceStylesGM : public skiagm::GM {
sk_sp<SkTypeface> fFaces[gFaceStylesCount];
« no previous file with comments | « gm/tilemodes_scaled.cpp ('k') | gm/variedtext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698