Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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";
15 SkPath path;
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
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition aaclip.cpp:27
void drawPath(const SkPath &path, const SkPaint &paint)
@ 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 *)
const Paint & paint
#define REG_FIDDLE(NAME, W, H, TEXT, I)
Definition examples.h:60