#include <dl_path_builder.h>
Public Member Functions | |
| DlPathBuilder & | SetFillType (DlPathFillType fill_type) |
| Set the fill type that should be used to determine the interior of this path to the indicated |fill_type|. | |
| DlPathBuilder & | MoveTo (DlPoint p2) |
| Start a new contour that will originate at the indicated point p2. | |
| DlPathBuilder & | LineTo (DlPoint p2) |
| Draw a line from the current point to the indicated point p2. | |
| DlPathBuilder & | QuadraticCurveTo (DlPoint cp, DlPoint p2) |
| Draw a quadratic bezier curve from the current point to the indicated point p2, using the indicated point cp as a control point. | |
| DlPathBuilder & | ConicCurveTo (DlPoint cp, DlPoint p2, DlScalar weight) |
| Draw a conic curve (a rational quadratic bezier curve) from the current point to the indicated point p2, using the indicated point cp as a control point and the indicated weight to control the contribution of the control point. | |
| DlPathBuilder & | CubicCurveTo (DlPoint cp1, DlPoint cp2, DlPoint p2) |
| Draw a cubic bezier curve from the current point to the indicated point p2, using the indicated points cp1 and cp2 as control points. | |
| DlPathBuilder & | Close () |
| The path is closed back to the location of the most recent MoveTo call. Contours that are filled are always implicitly assumed to be closed, but contours that are stroked will either: | |
| DlPathBuilder & | AddRect (const DlRect &rect) |
| Append a closed rectangular contour to the path. | |
| DlPathBuilder & | AddOval (const DlRect &bounds) |
| Append a closed elliptical contour to the path inscribed in the provided bounds. | |
| DlPathBuilder & | AddCircle (DlPoint center, DlScalar radius) |
| Append a closed circular contour to the path centered on the provided point at the provided radius. | |
| DlPathBuilder & | AddRoundRect (const DlRoundRect &round_rect) |
| Append a closed rounded rect contour to the path. | |
| DlPathBuilder & | AddRoundSuperellipse (const DlRoundSuperellipse &rse) |
| Append a closed rounded super-ellipse contour to the path. | |
| DlPathBuilder & | AddArc (const DlRect &bounds, DlDegrees start, DlDegrees sweep, bool use_center=false) |
| Append an arc contour to the path which: | |
| DlPathBuilder & | AddPath (const DlPath &path) |
| Append the provided path to this path as if the commands used to construct it were repeated on this path. The fill type of the current path will continue to be used, ignoring the fill type of the indicated path. | |
| const DlPath | CopyPath () |
| Returns the path constructed by this path builder so far and retains all current geometry to continue building the path. | |
| const DlPath | TakePath () |
| Returns the path constructed by this path builder and resets its internal state to the default state when it was constructed. | |
Static Public Attributes | |
| static constexpr const DlScalar | kArcApproximationMagic = 0.551915024494f |
Definition at line 14 of file dl_path_builder.h.
| DlPathBuilder & flutter::DlPathBuilder::AddArc | ( | const DlRect & | bounds, |
| DlDegrees | start, | ||
| DlDegrees | sweep, | ||
| bool | use_center = false |
||
| ) |
Append an arc contour to the path which:
Definition at line 129 of file dl_path_builder.cc.
References impeller::Degrees::degrees, impeller::TRect< T >::GetCenter(), start, flutter::ToSkPoint(), flutter::ToSkRect(), and use_center.
Referenced by flutter::testing::TEST(), flutter::testing::TEST(), and impeller::testing::TEST_P().
| DlPathBuilder & flutter::DlPathBuilder::AddCircle | ( | DlPoint | center, |
| DlScalar | radius | ||
| ) |
Append a closed circular contour to the path centered on the provided point at the provided radius.
Definition at line 110 of file dl_path_builder.cc.
Referenced by flutter::testing::CanvasCompareTester::RenderWithClips(), flutter::testing::TEST(), and impeller::testing::TEST_P().
| DlPathBuilder & flutter::DlPathBuilder::AddOval | ( | const DlRect & | bounds | ) |
Append a closed elliptical contour to the path inscribed in the provided bounds.
Definition at line 105 of file dl_path_builder.cc.
References flutter::ToSkRect().
Referenced by flutter::testing::TEST(), and flutter::testing::TEST().
| DlPathBuilder & flutter::DlPathBuilder::AddPath | ( | const DlPath & | path | ) |
Append the provided path to this path as if the commands used to construct it were repeated on this path. The fill type of the current path will continue to be used, ignoring the fill type of the indicated path.
Definition at line 143 of file dl_path_builder.cc.
References flutter::path.
Referenced by flutter::testing::TEST(), flutter::testing::TEST(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), and impeller::testing::TEST_P().
| DlPathBuilder & flutter::DlPathBuilder::AddRect | ( | const DlRect & | rect | ) |
Append a closed rectangular contour to the path.
Definition at line 100 of file dl_path_builder.cc.
References flutter::ToSkRect().
Referenced by flutter::testing::CanvasCompareTester::RenderWithClips(), flutter::testing::TEST(), flutter::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), and flutter::testing::TEST_F().
| DlPathBuilder & flutter::DlPathBuilder::AddRoundRect | ( | const DlRoundRect & | round_rect | ) |
Append a closed rounded rect contour to the path.
Definition at line 115 of file dl_path_builder.cc.
References flutter::ToSkRRect().
Referenced by flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().
| DlPathBuilder & flutter::DlPathBuilder::AddRoundSuperellipse | ( | const DlRoundSuperellipse & | rse | ) |
Append a closed rounded super-ellipse contour to the path.
Definition at line 120 of file dl_path_builder.cc.
References impeller::RoundSuperellipseParam::Dispatch(), impeller::RoundSuperellipse::GetBounds(), impeller::RoundSuperellipse::GetRadii(), and impeller::RoundSuperellipseParam::MakeBoundsRadii().
Referenced by flutter::CanvasPath::addRSuperellipse(), flutter::DlPath::MakeRoundSuperellipse(), and flutter::testing::TEST().
| DlPathBuilder & flutter::DlPathBuilder::Close | ( | ) |
The path is closed back to the location of the most recent MoveTo call. Contours that are filled are always implicitly assumed to be closed, but contours that are stroked will either:
Definition at line 95 of file dl_path_builder.cc.
Referenced by impeller::Close(), flutter::testing::GetConicsPath(), flutter::testing::GetCubicsPath(), flutter::testing::GetLinesPath(), flutter::testing::GetQuadsPath(), impeller::testing::MaskBlurVariantTest(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), and impeller::testing::TEST_P().
| DlPathBuilder & flutter::DlPathBuilder::ConicCurveTo | ( | DlPoint | cp, |
| DlPoint | p2, | ||
| DlScalar | weight | ||
| ) |
Draw a conic curve (a rational quadratic bezier curve) from the current point to the indicated point p2, using the indicated point cp as a control point and the indicated weight to control the contribution of the control point.
A weight of less than 0, or NaN, is treated is if it were 0 which produces a curve that is identical to a line segment and will be inserted as a line segment in lieu of the conic.
A weight of (sqrt(2)/2) will produce a quarter section of an elliptical path.
A weight of 1.0 is identical to a quadratic bezier curve and will be inserted as a quadratic curve in lieu of the conic.
If the path is empty, a new contour will automatically be started from the point (0, 0) as if |MoveTo| had been called.
Definition at line 74 of file dl_path_builder.cc.
References LineTo(), impeller::TPoint< T >::x, and impeller::TPoint< T >::y.
Referenced by flutter::testing::GetConicsPath(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), and flutter::testing::TestImpellerPathDispatchConicToQuads().
| const DlPath flutter::DlPathBuilder::CopyPath | ( | ) |
Returns the path constructed by this path builder so far and retains all current geometry to continue building the path.
Definition at line 148 of file dl_path_builder.cc.
Referenced by impeller::Tessellate(), and flutter::testing::TEST().
| DlPathBuilder & flutter::DlPathBuilder::CubicCurveTo | ( | DlPoint | cp1, |
| DlPoint | cp2, | ||
| DlPoint | p2 | ||
| ) |
Draw a cubic bezier curve from the current point to the indicated point p2, using the indicated points cp1 and cp2 as control points.
If the path is empty, a new contour will automatically be started from the point (0, 0) as if |MoveTo| had been called.
Definition at line 88 of file dl_path_builder.cc.
References impeller::TPoint< T >::x, and impeller::TPoint< T >::y.
Referenced by impeller::CubicTo(), flutter::testing::GetCubicsPath(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), flutter::testing::TEST_F(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), and flutter::testing::TEST_P().
| DlPathBuilder & flutter::DlPathBuilder::LineTo | ( | DlPoint | p2 | ) |
Draw a line from the current point to the indicated point p2.
If the path is empty, a new contour will automatically be started from the point (0, 0) as if |MoveTo| had been called.
Definition at line 64 of file dl_path_builder.cc.
References impeller::TPoint< T >::x, and impeller::TPoint< T >::y.
Referenced by ConicCurveTo(), flutter::testing::GetLinesPath(), impeller::LineTo(), impeller::testing::MaskBlurVariantTest(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), flutter::testing::TEST_P(), flutter::testing::TEST_P(), impeller::testing::TEST_P(), and impeller::testing::TEST_P().
| DlPathBuilder & flutter::DlPathBuilder::MoveTo | ( | DlPoint | p2 | ) |
Start a new contour that will originate at the indicated point p2.
Definition at line 59 of file dl_path_builder.cc.
References impeller::TPoint< T >::x, and impeller::TPoint< T >::y.
Referenced by flutter::testing::GetConicsPath(), flutter::testing::GetCubicsPath(), flutter::testing::GetLinesPath(), flutter::testing::GetQuadsPath(), impeller::testing::MaskBlurVariantTest(), impeller::MoveTo(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), flutter::testing::TEST_P(), flutter::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), and flutter::testing::TestImpellerPathDispatchConicToQuads().
| DlPathBuilder & flutter::DlPathBuilder::QuadraticCurveTo | ( | DlPoint | cp, |
| DlPoint | p2 | ||
| ) |
Draw a quadratic bezier curve from the current point to the indicated point p2, using the indicated point cp as a control point.
If the path is empty, a new contour will automatically be started from the point (0, 0) as if |MoveTo| had been called.
Definition at line 69 of file dl_path_builder.cc.
References impeller::TPoint< T >::x, and impeller::TPoint< T >::y.
Referenced by flutter::testing::GetQuadsPath(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), and impeller::testing::TEST_P().
| DlPathBuilder & flutter::DlPathBuilder::SetFillType | ( | DlPathFillType | fill_type | ) |
Set the fill type that should be used to determine the interior of this path to the indicated |fill_type|.
Definition at line 54 of file dl_path_builder.cc.
Referenced by flutter::testing::CanvasCompareTester::RenderWithClips(), impeller::Tessellate(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), impeller::testing::TEST(), flutter::testing::TEST_F(), impeller::testing::TEST_P(), and impeller::testing::TEST_P().
| const DlPath flutter::DlPathBuilder::TakePath | ( | ) |
Returns the path constructed by this path builder and resets its internal state to the default state when it was constructed.
Definition at line 152 of file dl_path_builder.cc.
Referenced by flutter::CanvasPath::addRSuperellipse(), flutter::testing::BM_DrawPath(), flutter::testing::BM_DrawShadow(), flutter::DlPath::MakeRoundSuperellipse(), impeller::testing::MaskBlurVariantTest(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), flutter::testing::TEST_P(), flutter::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), and flutter::testing::TestImpellerPathDispatchConicToQuads().
|
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 dl_path_builder.h.
Referenced by impeller::testing::TEST_P(), impeller::testing::TEST_P(), and flutter::testing::TEST_P().