Flutter Engine
The Flutter Engine
SkParsePath_FromSVGString.cpp
Go to the documentation of this file.
1// Copyright 2020 Google LLC.
2// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
4REG_FIDDLE(SkParsePath_FromSVGString, 256, 256, false, 0) {
5void draw(SkCanvas* canvas) {
6 const char pathString[] =
7 "M 243 128 "
8 "L 24 178 "
9 "L 200 38 "
10 "L 102 240 "
11 "L 102 16 "
12 "L 200 218 "
13 "L 24 78 "
14 "Z";
16 SkParsePath::FromSVGString(pathString, &path);
18 paint.setAntiAlias(true);
20 paint.setStrokeCap(SkPaint::kRound_Cap);
21 paint.setStrokeWidth(2);
22 canvas->drawPath(path, paint);
23}
24} // END FIDDLE
REG_FIDDLE(SkParsePath_FromSVGString, 256, 256, false, 0)
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
void drawPath(const SkPath &path, const SkPaint &paint)
Definition: SkCanvas.cpp:1747
@ kRound_Cap
adds circle
Definition: SkPaint.h:335
@ kStroke_Style
set to stroke geometry
Definition: SkPaint.h:194
static bool FromSVGString(const char str[], SkPath *)
Definition: SkPath.h:59
const Paint & paint
Definition: color_source.cc:38
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition: switches.h:57