OLD | NEW |
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 Loading... |
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;) |
OLD | NEW |