5#ifndef FLUTTER_IMPELLER_GEOMETRY_PATH_H_
6#define FLUTTER_IMPELLER_GEOMETRY_PATH_H_
123 size_t contour_index)
const;
169 std::make_unique<std::vector<Point>>(),
186 struct ComponentIndexPair {
190 ComponentIndexPair() {}
193 :
type(a_type), index(a_index) {}
216 std::vector<ComponentIndexPair> components;
217 std::vector<Point>
points;
218 std::vector<ContourComponent> contours;
220 std::optional<Rect>
bounds;
225 std::shared_ptr<const Data> data_;
228static_assert(
sizeof(
Path) ==
sizeof(std::shared_ptr<struct Anonymous>));
static const int points[]
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
bool GetContourComponentAtIndex(size_t index, ContourComponent &contour) const
void EnumerateComponents(const Applier< LinearPathComponent > &linear_applier, const Applier< QuadraticPathComponent > &quad_applier, const Applier< CubicPathComponent > &cubic_applier, const Applier< ContourComponent > &contour_applier) const
std::optional< Rect > GetTransformedBoundingBox(const Matrix &transform) const
std::function< void(size_t index, const T &component)> Applier
bool GetLinearComponentAtIndex(size_t index, LinearPathComponent &linear) const
void WritePolyline(Scalar scale, VertexWriter &writer) const
bool GetQuadraticComponentAtIndex(size_t index, QuadraticPathComponent &quadratic) const
bool GetCubicComponentAtIndex(size_t index, CubicPathComponent &cubic) const
Polyline CreatePolyline(Scalar scale, Polyline::PointBufferPtr point_buffer=std::make_unique< std::vector< Point > >(), Polyline::ReclaimPointBufferCallback reclaim=nullptr) const
std::optional< Rect > GetBoundingBox() const
An interface for generating a multi contour polyline as a triangle strip.
Dart_NativeFunction function
Optional< SkRect > bounds
struct PathData * Data(SkPath *path)
static SkColor4f transform(SkColor4f c, SkColorSpace *src, SkColorSpace *dst)
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
static sk_sp< SkShader > linear(sk_sp< SkShader > shader)