5 #ifndef FLUTTER_IMPELLER_GEOMETRY_PATH_H_
6 #define FLUTTER_IMPELLER_GEOMETRY_PATH_H_
78 return component_index_ == other.component_index_;
81 return component_index_ != other.component_index_;
86 : path_(path), component_index_(index), storage_offset_(
offset) {}
89 size_t component_index_ = 0u;
90 size_t storage_offset_ = 0u;
174 size_t contour_index)
const;
197 ComponentIterator
begin()
const;
198 ComponentIterator
end()
const;
209 std::make_unique<std::vector<Point>>(),
213 size_t storage_offset,
215 size_t component_index,
216 std::vector<PolylineContour::Component>& poly_components)
const;
247 Data(Data&& other) =
default;
249 Data(
const Data& other) =
default;
255 bool single_contour =
true;
256 std::optional<Rect> bounds;
257 std::vector<Point> points;
258 std::vector<ComponentType> components;
263 std::shared_ptr<const Data> data_;
266 static_assert(
sizeof(Path) ==
sizeof(std::shared_ptr<struct Anonymous>));
const ContourComponent * contour() const
ComponentIterator & operator++()
const QuadraticPathComponent * quadratic() const
ComponentType type() const
const LinearPathComponent * linear() const
const ConicPathComponent * conic() const
bool operator!=(const ComponentIterator &other) const
bool operator==(const ComponentIterator &other) const
const CubicPathComponent * cubic() const
Paths are lightweight objects that describe a collection of linear, quadratic, or cubic segments....
FillType GetFillType() const
size_t GetComponentCount(std::optional< ComponentType > type={}) const
ComponentIterator begin() const
Polyline CreatePolyline(Scalar scale, Polyline::PointBufferPtr point_buffer=std::make_unique< std::vector< Point >>(), Polyline::ReclaimPointBufferCallback reclaim=nullptr) const
bool IsSingleContour() const
Whether the line contains a single contour.
std::optional< Rect > GetTransformedBoundingBox(const Matrix &transform) const
static constexpr size_t VerbToOffset(Path::ComponentType verb)
ComponentIterator end() const
size_t GetPointCount() const
void WritePolyline(Scalar scale, VertexWriter &writer) const
void EndContour(size_t storage_offset, Polyline &polyline, size_t component_index, std::vector< PolylineContour::Component > &poly_components) const
std::optional< Rect > GetBoundingBox() const
std::pair< size_t, size_t > CountStorage(Scalar scale) const
Determine required storage for points and number of contours.
An interface for generating a multi contour polyline as a triangle strip.
const Path::Polyline & polyline
A 4x4 matrix using column-major storage.
size_t component_start_index
Vector2 start_direction
The direction of the contour's start cap.
size_t start_index
Index that denotes the first point of this contour.
std::vector< Component > components
Vector2 end_direction
The direction of the contour's end cap.
Polyline(PointBufferPtr point_buffer, ReclaimPointBufferCallback reclaim)
std::vector< PolylineContour > contours
Point & GetPoint(size_t index) const
std::function< void(PointBufferPtr)> ReclaimPointBufferCallback
std::unique_ptr< std::vector< Point > > PointBufferPtr
std::tuple< size_t, size_t > GetContourPointBounds(size_t contour_index) const
std::shared_ptr< const fml::Mapping > data