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

Unified Diff: gm/texdata.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/tallstretchedbitmaps.cpp ('k') | gm/textblobblockreordering.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/texdata.cpp
diff --git a/gm/texdata.cpp b/gm/texdata.cpp
index 0c23749e02ed9a3306dc852525bbd66a63ef3116..5fb90839f91cf30ac9e91a89b52b27c01645fa14 100644
--- a/gm/texdata.cpp
+++ b/gm/texdata.cpp
@@ -17,7 +17,7 @@
#include "effects/GrPorterDuffXferProcessor.h"
#include "effects/GrSimpleTextureEffect.h"
-static const int S = 200;
+constexpr int S = 200;
DEF_SIMPLE_GM_BG(texdata, canvas, 2 * S, 2 * S, SK_ColorBLACK) {
GrDrawContext* drawContext = canvas->internal_private_accessTopLayerDrawContext();
@@ -32,13 +32,13 @@ DEF_SIMPLE_GM_BG(texdata, canvas, 2 * S, 2 * S, SK_ColorBLACK) {
}
SkAutoTArray<SkPMColor> gTextureData((2 * S) * (2 * S));
- static const int stride = 2 * S;
- static const SkPMColor gray = SkPackARGB32(0x40, 0x40, 0x40, 0x40);
- static const SkPMColor white = SkPackARGB32(0xff, 0xff, 0xff, 0xff);
- static const SkPMColor red = SkPackARGB32(0x80, 0x80, 0x00, 0x00);
- static const SkPMColor blue = SkPackARGB32(0x80, 0x00, 0x00, 0x80);
- static const SkPMColor green = SkPackARGB32(0x80, 0x00, 0x80, 0x00);
- static const SkPMColor black = SkPackARGB32(0x00, 0x00, 0x00, 0x00);
+ constexpr int stride = 2 * S;
+ const SkPMColor gray = SkPackARGB32(0x40, 0x40, 0x40, 0x40);
+ const SkPMColor white = SkPackARGB32(0xff, 0xff, 0xff, 0xff);
+ const SkPMColor red = SkPackARGB32(0x80, 0x80, 0x00, 0x00);
+ const SkPMColor blue = SkPackARGB32(0x80, 0x00, 0x00, 0x80);
+ const SkPMColor green = SkPackARGB32(0x80, 0x00, 0x80, 0x00);
+ const SkPMColor black = SkPackARGB32(0x00, 0x00, 0x00, 0x00);
for (int i = 0; i < 2; ++i) {
int offset = 0;
// fill upper-left
« no previous file with comments | « gm/tallstretchedbitmaps.cpp ('k') | gm/textblobblockreordering.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698