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

Side by Side Diff: gm/pictureimagegenerator.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 unified diff | Download patch
« no previous file with comments | « gm/perspshaders.cpp ('k') | gm/pictureshadertile.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "gm.h" 8 #include "gm.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
11 #include "SkGradientShader.h" 11 #include "SkGradientShader.h"
12 #include "SkImageGenerator.h" 12 #include "SkImageGenerator.h"
13 #include "SkPaint.h" 13 #include "SkPaint.h"
14 #include "SkPathOps.h" 14 #include "SkPathOps.h"
15 #include "SkPicture.h" 15 #include "SkPicture.h"
16 #include "SkPictureRecorder.h" 16 #include "SkPictureRecorder.h"
17 17
18 static void draw_vector_logo(SkCanvas* canvas, const SkRect& viewBox) { 18 static void draw_vector_logo(SkCanvas* canvas, const SkRect& viewBox) {
19 static const char kSkiaStr[] = "SKIA"; 19 constexpr char kSkiaStr[] = "SKIA";
20 static const SkScalar kGradientPad = .1f; 20 constexpr SkScalar kGradientPad = .1f;
21 static const SkScalar kVerticalSpacing = 0.25f; 21 constexpr SkScalar kVerticalSpacing = 0.25f;
22 static const SkScalar kAccentScale = 1.20f; 22 constexpr SkScalar kAccentScale = 1.20f;
23 23
24 SkPaint paint; 24 SkPaint paint;
25 paint.setAntiAlias(true); 25 paint.setAntiAlias(true);
26 paint.setSubpixelText(true); 26 paint.setSubpixelText(true);
27 paint.setFakeBoldText(true); 27 paint.setFakeBoldText(true);
28 sk_tool_utils::set_portable_typeface(&paint); 28 sk_tool_utils::set_portable_typeface(&paint);
29 29
30 SkPath path; 30 SkPath path;
31 SkRect iBox, skiBox, skiaBox; 31 SkRect iBox, skiBox, skiaBox;
32 paint.getTextPath("SKI", 3, 0, 0, &path); 32 paint.getTextPath("SKI", 3, 0, 0, &path);
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 private: 173 private:
174 sk_sp<SkPicture> fPicture; 174 sk_sp<SkPicture> fPicture;
175 175
176 const SkScalar kPictureWidth = 200; 176 const SkScalar kPictureWidth = 200;
177 const SkScalar kPictureHeight = 100; 177 const SkScalar kPictureHeight = 100;
178 178
179 typedef skiagm::GM INHERITED; 179 typedef skiagm::GM INHERITED;
180 }; 180 };
181 181
182 DEF_GM(return new PictureGeneratorGM;) 182 DEF_GM(return new PictureGeneratorGM;)
OLDNEW
« no previous file with comments | « gm/perspshaders.cpp ('k') | gm/pictureshadertile.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698