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

Unified Diff: gm/filterfastbounds.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/emptypath.cpp ('k') | gm/fontmgr.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/filterfastbounds.cpp
diff --git a/gm/filterfastbounds.cpp b/gm/filterfastbounds.cpp
index 408a4e87091b5133ee06418a74e40310f9b46257..812c6668eae7db747fd2236044c9dd935d0cea6f 100644
--- a/gm/filterfastbounds.cpp
+++ b/gm/filterfastbounds.cpp
@@ -78,7 +78,7 @@ static void draw_bitmap(SkCanvas* canvas, const SkRect& r, const SkPaint& p) {
canvas->drawBitmapRect(bm, r, &p);
}
-static const drawMth gDrawMthds[] = {
+constexpr drawMth gDrawMthds[] = {
draw_rect, draw_oval, draw_rrect, draw_drrect, draw_path, draw_points, draw_bitmap
};
@@ -119,7 +119,7 @@ static void create_paints(SkTArray<SkPaint>* paints, sk_sp<SkImageFilter> source
}
{
- static const SkDropShadowImageFilter::ShadowMode kBoth =
+ constexpr SkDropShadowImageFilter::ShadowMode kBoth =
SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode;
sk_sp<SkImageFilter> dsif(SkDropShadowImageFilter::Make(10.0f, 10.0f,
@@ -154,10 +154,10 @@ public:
}
protected:
- static const int kTileWidth = 100;
- static const int kTileHeight = 100;
- static const int kNumVertTiles = 7;
- static const int kNumXtraCols = 2;
+ static constexpr int kTileWidth = 100;
+ static constexpr int kTileHeight = 100;
+ static constexpr int kNumVertTiles = 7;
+ static constexpr int kNumXtraCols = 2;
SkString onShortName() override{ return SkString("filterfastbounds"); }
« no previous file with comments | « gm/emptypath.cpp ('k') | gm/fontmgr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698