Flutter Engine
The Flutter Engine
third_party
skia
docs
examples
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.
3
#include "
tools/fiddle/examples.h
"
4
REG_FIDDLE
(FillPathWithPaint_2, 256, 128,
false
, 0) {
5
void
draw
(
SkCanvas
* canvas) {
6
SkPaint
paint
;
7
paint
.setStyle(
SkPaint::kStroke_Style
);
8
paint
.setStrokeWidth(10);
9
SkPath
strokePath
;
10
strokePath
.moveTo(20, 20);
11
strokePath
.lineTo(100, 100);
12
canvas->
drawPath
(
strokePath
,
paint
);
13
SkPath
fillPath;
14
skpathutils::FillPathWithPaint
(
strokePath
,
paint
, &fillPath);
15
paint
.setStrokeWidth(2);
16
canvas->
translate
(40, 0);
17
canvas->
drawPath
(fillPath,
paint
);
18
}
19
}
// END FIDDLE
REG_FIDDLE
REG_FIDDLE(FillPathWithPaint_2, 256, 128, false, 0)
Definition:
FillPathWithPaint_2.cpp:4
draw
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition:
aaclip.cpp:27
SkCanvas
Definition:
SkCanvas.h:106
SkCanvas::translate
void translate(SkScalar dx, SkScalar dy)
Definition:
SkCanvas.cpp:1278
SkCanvas::drawPath
void drawPath(const SkPath &path, const SkPaint &paint)
Definition:
SkCanvas.cpp:1747
SkPaint
Definition:
SkPaint.h:44
SkPaint::kStroke_Style
@ kStroke_Style
set to stroke geometry
Definition:
SkPaint.h:194
SkPath
Definition:
SkPath.h:59
paint
const Paint & paint
Definition:
color_source.cc:38
examples.h
strokePath
static void strokePath(SkCanvas *canvas, const SkPath &path)
Definition:
getpostextpath.cpp:29
skpathutils::FillPathWithPaint
SK_API bool FillPathWithPaint(const SkPath &src, const SkPaint &paint, SkPath *dst, const SkRect *cullRect, SkScalar resScale=1)
Definition:
SkPathUtils.cpp:23
Generated on Sun Jun 23 2024 21:55:55 for Flutter Engine by
1.9.4