Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition aaclip.cpp:27
void translate(SkScalar dx, SkScalar dy)
void drawPath(const SkPath &path, const SkPaint &paint)
@ kStroke_Style
set to stroke geometry
Definition SkPaint.h:194
SkPath & moveTo(SkScalar x, SkScalar y)
Definition SkPath.cpp:678
SkPath & lineTo(SkScalar x, SkScalar y)
Definition SkPath.cpp:718
const Paint & paint
#define REG_FIDDLE(NAME, W, H, TEXT, I)
Definition examples.h:60
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)