Flutter Engine
The Flutter Engine
FillPathWithPaint_2.cpp
Go to the documentation of this file.
1// Copyright 2019 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(FillPathWithPaint_2, 256, 128, false, 0) {
5void draw(SkCanvas* canvas) {
8 paint.setStrokeWidth(10);
10 strokePath.moveTo(20, 20);
11 strokePath.lineTo(100, 100);
12 canvas->drawPath(strokePath, paint);
13 SkPath fillPath;
15 paint.setStrokeWidth(2);
16 canvas->translate(40, 0);
17 canvas->drawPath(fillPath, paint);
18}
19} // END FIDDLE
REG_FIDDLE(FillPathWithPaint_2, 256, 128, false, 0)
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
void translate(SkScalar dx, SkScalar dy)
Definition: SkCanvas.cpp:1278
void drawPath(const SkPath &path, const SkPaint &paint)
Definition: SkCanvas.cpp:1747
@ kStroke_Style
set to stroke geometry
Definition: SkPaint.h:194
Definition: SkPath.h:59
const Paint & paint
Definition: color_source.cc:38
static void strokePath(SkCanvas *canvas, const SkPath &path)
SK_API bool FillPathWithPaint(const SkPath &src, const SkPaint &paint, SkPath *dst, const SkRect *cullRect, SkScalar resScale=1)
Definition: SkPathUtils.cpp:23