Flutter Engine
The Flutter Engine
|
#include <path_builder.h>
Classes | |
struct | RoundingRadii |
Public Member Functions | |
PathBuilder () | |
~PathBuilder () | |
Path | CopyPath (FillType fill=FillType::kNonZero) |
Path | TakePath (FillType fill=FillType::kNonZero) |
void | Reserve (size_t point_size, size_t verb_size) |
Reserve [point_size] points and [verb_size] verbs in the underlying path buffer. More... | |
PathBuilder & | SetConvexity (Convexity value) |
PathBuilder & | MoveTo (Point point, bool relative=false) |
PathBuilder & | Close () |
PathBuilder & | LineTo (Point point, bool relative=false) |
Insert a line from the current position to point . More... | |
PathBuilder & | HorizontalLineTo (Scalar x, bool relative=false) |
PathBuilder & | VerticalLineTo (Scalar y, bool relative=false) |
PathBuilder & | QuadraticCurveTo (Point controlPoint, Point point, bool relative=false) |
Insert a quadradic curve from the current position to point using the control point controlPoint . More... | |
PathBuilder & | CubicCurveTo (Point controlPoint1, Point controlPoint2, Point point, bool relative=false) |
Insert a cubic curve from the curren position to point using the control points controlPoint1 and controlPoint2 . More... | |
PathBuilder & | AddRect (Rect rect) |
PathBuilder & | AddCircle (const Point ¢er, Scalar radius) |
PathBuilder & | AddArc (const Rect &oval_bounds, Radians start, Radians sweep, bool use_center=false) |
PathBuilder & | AddOval (const Rect &rect) |
PathBuilder & | AddLine (const Point &p1, const Point &p2) |
Move to point p1 , then insert a line from p1 to p2 . More... | |
PathBuilder & | AddQuadraticCurve (Point p1, Point cp, Point p2) |
Move to point p1 , then insert a quadradic curve from p1 to p2 with the control point cp . More... | |
PathBuilder & | AddCubicCurve (Point p1, Point cp1, Point cp2, Point p2) |
Move to point p1 , then insert a cubic curve from p1 to p2 with control points cp1 and cp2 . More... | |
PathBuilder & | Shift (Point offset) |
Transform the existing path segments and contours by the given offset . More... | |
PathBuilder & | SetBounds (Rect bounds) |
Set the bounding box that will be used by Path.GetBoundingBox in place of performing the computation. More... | |
PathBuilder & | AddRoundedRect (Rect rect, RoundingRadii radii) |
PathBuilder & | AddRoundedRect (Rect rect, Size radii) |
PathBuilder & | AddRoundedRect (Rect rect, Scalar radius) |
PathBuilder & | AddPath (const Path &path) |
Static Public Attributes | |
static constexpr const Scalar | kArcApproximationMagic = 0.551915024494f |
Definition at line 14 of file path_builder.h.
impeller::PathBuilder::PathBuilder | ( | ) |
Definition at line 11 of file path_builder.cc.
|
default |
PathBuilder & impeller::PathBuilder::AddArc | ( | const Rect & | oval_bounds, |
Radians | start, | ||
Radians | sweep, | ||
bool | use_center = false |
||
) |
Definition at line 318 of file path_builder.cc.
PathBuilder & impeller::PathBuilder::AddCircle | ( | const Point & | center, |
Scalar | radius | ||
) |
Definition at line 135 of file path_builder.cc.
PathBuilder & impeller::PathBuilder::AddCubicCurve | ( | Point | p1, |
Point | cp1, | ||
Point | cp2, | ||
Point | p2 | ||
) |
Move to point p1
, then insert a cubic curve from p1
to p2
with control points cp1
and cp2
.
Definition at line 108 of file path_builder.cc.
PathBuilder & impeller::PathBuilder::AddLine | ( | const Point & | p1, |
const Point & | p2 | ||
) |
Move to point p1
, then insert a line from p1
to p2
.
Definition at line 424 of file path_builder.cc.
PathBuilder & impeller::PathBuilder::AddOval | ( | const Rect & | rect | ) |
Definition at line 376 of file path_builder.cc.
PathBuilder & impeller::PathBuilder::AddPath | ( | const Path & | path | ) |
Definition at line 430 of file path_builder.cc.
PathBuilder & impeller::PathBuilder::AddQuadraticCurve | ( | Point | p1, |
Point | cp, | ||
Point | p2 | ||
) |
Move to point p1
, then insert a quadradic curve from p1
to p2
with the control point cp
.
Definition at line 102 of file path_builder.cc.
PathBuilder & impeller::PathBuilder::AddRect | ( | Rect | rect | ) |
Definition at line 117 of file path_builder.cc.
PathBuilder & impeller::PathBuilder::AddRoundedRect | ( | Rect | rect, |
RoundingRadii | radii | ||
) |
Definition at line 150 of file path_builder.cc.
PathBuilder & impeller::PathBuilder::AddRoundedRect | ( | Rect | rect, |
Scalar | radius | ||
) |
Definition at line 139 of file path_builder.cc.
PathBuilder & impeller::PathBuilder::AddRoundedRect | ( | Rect | rect, |
Size | radii | ||
) |
Definition at line 144 of file path_builder.cc.
PathBuilder & impeller::PathBuilder::Close | ( | ) |
Definition at line 40 of file path_builder.cc.
Path impeller::PathBuilder::CopyPath | ( | FillType | fill = FillType::kNonZero | ) |
Definition at line 17 of file path_builder.cc.
PathBuilder & impeller::PathBuilder::CubicCurveTo | ( | Point | controlPoint1, |
Point | controlPoint2, | ||
Point | point, | ||
bool | relative = false |
||
) |
Insert a cubic curve from the curren position to point
using the control points controlPoint1
and controlPoint2
.
If relative
is true the point
, controlPoint1
, and controlPoint2
are relative to current location.
Definition at line 90 of file path_builder.cc.
PathBuilder & impeller::PathBuilder::HorizontalLineTo | ( | Scalar | x, |
bool | relative = false |
||
) |
Definition at line 59 of file path_builder.cc.
PathBuilder & impeller::PathBuilder::LineTo | ( | Point | point, |
bool | relative = false |
||
) |
Insert a line from the current position to point
.
If relative
is true, then point
is relative to the current location.
Definition at line 52 of file path_builder.cc.
PathBuilder & impeller::PathBuilder::MoveTo | ( | Point | point, |
bool | relative = false |
||
) |
Definition at line 33 of file path_builder.cc.
PathBuilder & impeller::PathBuilder::QuadraticCurveTo | ( | Point | controlPoint, |
Point | point, | ||
bool | relative = false |
||
) |
Insert a quadradic curve from the current position to point
using the control point controlPoint
.
If relative
is true the point
and controlPoint
are relative to current location.
Definition at line 75 of file path_builder.cc.
void impeller::PathBuilder::Reserve | ( | size_t | point_size, |
size_t | verb_size | ||
) |
Reserve [point_size] points and [verb_size] verbs in the underlying path buffer.
Definition at line 28 of file path_builder.cc.
PathBuilder & impeller::PathBuilder::SetBounds | ( | Rect | bounds | ) |
Set the bounding box that will be used by Path.GetBoundingBox
in place of performing the computation.
When Impeller recieves Skia Path objects, many of these already have computed bounds. This method is used to avoid needlessly recomputing these bounds.
Definition at line 458 of file path_builder.cc.
PathBuilder & impeller::PathBuilder::SetConvexity | ( | Convexity | value | ) |
Definition at line 85 of file path_builder.cc.
PathBuilder & impeller::PathBuilder::Shift | ( | Point | offset | ) |
Transform the existing path segments and contours by the given offset
.
Definition at line 447 of file path_builder.cc.
Path impeller::PathBuilder::TakePath | ( | FillType | fill = FillType::kNonZero | ) |
Definition at line 22 of file path_builder.cc.
PathBuilder & impeller::PathBuilder::VerticalLineTo | ( | Scalar | y, |
bool | relative = false |
||
) |
|
staticconstexpr |
Used for approximating quarter circle arcs with cubic curves. This is the control point distance which results in the smallest possible unit circle integration for a right angle arc. It can be used to approximate arcs less than 90 degrees to great effect by simply reducing it proportionally to the angle. However, accuracy rapidly diminishes if magnified for obtuse angle arcs, and so multiple cubic curves should be used when approximating arcs greater than 90 degrees.
Definition at line 23 of file path_builder.h.