| Flutter Impeller |

Public Member Functions | Protected Member Functions | List of all members
impeller::ArcStrokeGeometry Class Referencefinal

A Geometry that produces fillable vertices representing the stroked outline of an |Arc| object using the base class |StrokeSegmentsGeometry| and utilizing the special |RecordArc| extension method provided by the |PathAndArcSegmentReceiver|. More...

`#include <stroke_path_geometry.h>`

Inheritance diagram for impeller::ArcStrokeGeometry:

## Public Member Functions
| ArcStrokeGeometry (const Arc &arc, const StrokeParameters &parameters)
Public Member Functions inherited from impeller::StrokeSegmentsGeometry
| ~StrokeSegmentsGeometry () override
Scalar | GetStrokeWidth () const
Scalar | GetMiterLimit () const
Cap | GetStrokeCap () const
Join | GetStrokeJoin () const
Scalar | ComputeAlphaCoverage (const Matrix &transform) const override
Public Member Functions inherited from impeller::Geometry
virtual | ~Geometry ()
virtual bool | CoversArea (const Matrix &transform, const Rect &rect) const
| Determines if this geometry, transformed by the given `transform`, will completely cover all surface area of the given `rect`. More...
virtual bool | IsAxisAlignedRect () const
virtual bool | CanApplyMaskFilter () const

## Protected Member Functions
std::optional< Rect > | GetCoverage (const Matrix &transform) const override
void | Dispatch (PathAndArcSegmentReceiver &receiver, Tessellator &tessellator, Scalar scale) const override
Protected Member Functions inherited from impeller::StrokeSegmentsGeometry
| StrokeSegmentsGeometry (const StrokeParameters &parameters)
std::optional< Rect > | GetStrokeCoverage (const Matrix &transform, const Rect &segment_bounds) const

## Additional Inherited Members
Static Public Member Functions inherited from impeller::Geometry
static std::unique_ptr< Geometry > | MakeFillPath (const flutter::DlPath &path, std::optional< Rect > inner_rect=std::nullopt)
static std::unique_ptr< Geometry > | MakeStrokePath (const flutter::DlPath &path, const StrokeParameters &stroke={})
static std::unique_ptr< Geometry > | MakeCover ()
static std::unique_ptr< Geometry > | MakeRect (const Rect &rect)
static std::unique_ptr< Geometry > | MakeOval (const Rect &rect)
static std::unique_ptr< Geometry > | MakeLine (const Point &p0, const Point &p1, const StrokeParameters &stroke)
static std::unique_ptr< Geometry > | MakeCircle (const Point &center, Scalar radius)
static std::unique_ptr< Geometry > | MakeStrokedCircle (const Point &center, Scalar radius, Scalar stroke_width)
static std::unique_ptr< Geometry > | MakeFilledArc (const Rect &oval_bounds, Degrees start, Degrees sweep, bool include_center)
static std::unique_ptr< Geometry > | MakeStrokedArc (const Rect &oval_bounds, Degrees start, Degrees sweep, const StrokeParameters &stroke)
static std::unique_ptr< Geometry > | MakeRoundRect (const Rect &rect, const Size &radii)
static std::unique_ptr< Geometry > | MakeRoundSuperellipse (const Rect &rect, Scalar corner_radius)
static Scalar | ComputeStrokeAlphaCoverage (const Matrix &entity, Scalar stroke_width)
| Compute an alpha value to simulate lower coverage of fractional pixel strokes. More...
static GeometryResult | ComputePositionGeometry (const ContentContext &renderer, const Tessellator::VertexGenerator &generator, const Entity &entity, RenderPass &pass)

## Detailed Description

A Geometry that produces fillable vertices representing the stroked outline of an |Arc| object using the base class |StrokeSegmentsGeometry| and utilizing the special |RecordArc| extension method provided by the |PathAndArcSegmentReceiver|.

Definition at line 132 of file stroke_path_geometry.h.

## Constructor & Destructor Documentation

## ◆ ArcStrokeGeometry()

impeller::ArcStrokeGeometry::ArcStrokeGeometry | ( | const Arc & | arc,
|  | const StrokeParameters & | parameters
| ) |  |

Definition at line 862 of file stroke_path_geometry.cc.

864 : StrokeSegmentsGeometry(parameters), arc_(arc) {}
impeller::StrokeSegmentsGeometry::StrokeSegmentsGeometry
StrokeSegmentsGeometry(const StrokeParameters &parameters)
Definition: stroke_path_geometry.cc:714

## Member Function Documentation

## ◆ Dispatch()

void impeller::ArcStrokeGeometry::Dispatch | ( | PathAndArcSegmentReceiver & | receiver,
|  | Tessellator & | tessellator,
|  | Scalar | scale
| ) |  | const
| override protected virtual

Dispatch the path segments to the StrokePathSegmentReceiver for the provided transform scale.

Implements impeller::StrokeSegmentsGeometry.

Definition at line 871 of file stroke_path_geometry.cc.

873 {
874 Point center = arc_.GetOvalCenter();
875 Size radii = arc_.GetOvalSize() * 0.5f;
876
877 auto trigs =
878 tessellator.GetTrigsForDeviceRadius(scale * radii.MaxDimension());
879 Arc::Iteration iterator =
880 arc_.ComputeIterations(trigs.GetSteps(), /*simplify_360=*/false);
881 Point start = center + iterator.start * radii;
882 bool include_center = arc_.IncludeCenter();
883
884 receiver.BeginContour(start, include_center);
885 receiver.RecordArc(arc_, center, radii);
886 if (include_center) {
887 Point end = center + iterator.end * radii;
888 receiver.RecordLine(end, center);
889 receiver.RecordLine(center, start);
890 }
891 receiver.EndContour(start, include_center);
892 }
impeller::Point
TPoint< Scalar > Point
Definition: point.h:425
impeller::Size
TSize< Scalar > Size
Definition: size.h:159
impeller::Arc::ComputeIterations
Iteration ComputeIterations(size_t step_count, bool simplify_360=true) const
Definition: arc.cc:102
impeller::Arc::IncludeCenter
constexpr bool IncludeCenter() const
Definition: arc.h:110
impeller::Arc::GetOvalSize
const Size GetOvalSize() const
Returns the size of the oval bounds.
Definition: arc.h:100
impeller::Arc::GetOvalCenter
const Point GetOvalCenter() const
Returns the center of the oval bounds.
Definition: arc.h:97
start
const size_t start
Definition: tessellator_libtess.cc:62
end
const size_t end
Definition: tessellator_libtess.cc:63

References impeller::PathTessellator::SegmentReceiver::BeginContour(), impeller::Arc::ComputeIterations(), impeller::Arc::Iteration::end, end, impeller::PathTessellator::SegmentReceiver::EndContour(), impeller::Arc::GetOvalCenter(), impeller::Arc::GetOvalSize(), impeller::Tessellator::GetTrigsForDeviceRadius(), impeller::Arc::IncludeCenter(), impeller::TSize< T >::MaxDimension(), impeller::PathAndArcSegmentReceiver::RecordArc(), impeller::PathTessellator::SegmentReceiver::RecordLine(), impeller::Arc::Iteration::start, and start.

## ◆ GetCoverage()

std::optional< Rect > impeller::ArcStrokeGeometry::GetCoverage | ( | const Matrix & | transform | ) | const
| override protected virtual

Implements impeller::Geometry.

Definition at line 866 of file stroke_path_geometry.cc.

867 {
868 return GetStrokeCoverage(transform, arc_.GetTightArcBounds());
869 }
impeller::StrokeSegmentsGeometry::GetStrokeCoverage
std::optional< Rect > GetStrokeCoverage(const Matrix &transform, const Rect &segment_bounds) const
Definition: stroke_path_geometry.cc:815
transform
Matrix transform
Definition: gaussian_blur_filter_contents.cc:312
impeller::Arc::GetTightArcBounds
Rect GetTightArcBounds() const
Definition: arc.cc:59

References impeller::StrokeSegmentsGeometry::GetStrokeCoverage(), impeller::Arc::GetTightArcBounds(), and transform.

The documentation for this class was generated from the following files:

- impeller/entity/geometry/stroke_path_geometry.h
- impeller/entity/geometry/stroke_path_geometry.cc