31 using VT = SolidFillVertexShader::PerVertexData;
40 count *
sizeof(VT),
alignof(VT),
41 [&generator](uint8_t* buffer) {
42 auto vertices =
reinterpret_cast<VT*
>(buffer);
48 FML_DCHECK(vertices ==
reinterpret_cast<VT*
>(buffer) +
51 .vertex_count = count,
64 std::optional<Rect> inner_rect) {
65 return std::make_unique<FillPathGeometry>(path, inner_rect);
76 return std::make_unique<StrokePathGeometry>(path, parameters);
80 return std::make_unique<CoverGeometry>();
84 return std::make_unique<FillRectGeometry>(rect);
88 return std::make_unique<EllipseGeometry>(rect);
94 return std::make_unique<LineGeometry>(p0, p1, stroke);
99 return std::make_unique<CircleGeometry>(center, radius);
105 return std::make_unique<CircleGeometry>(center, radius, stroke_width);
111 bool include_center) {
112 return std::make_unique<ArcGeometry>(
113 Arc(oval_bounds,
start, sweep, include_center));
117 const Rect& oval_bounds,
121 return std::make_unique<ArcGeometry>(
Arc(oval_bounds,
start, sweep,
false),
127 return std::make_unique<RoundRectGeometry>(rect, radii);
133 return std::make_unique<RoundSuperellipseGeometry>(rect, corner_radius);
151 Scalar scaled_stroke_width =
transform.GetMaxBasisLengthXY() * stroke_width;
152 if (scaled_stroke_width == 0.0 || scaled_stroke_width >=
kMinStrokeSize) {
156 return std::clamp(scaled_stroke_width * 2.0f, 0.f, 1.f);
HostBuffer & GetTransientsBuffer() const
Retrieve the currnent host buffer for transient storage.
Matrix GetShaderTransform(const RenderPass &pass) const
static std::unique_ptr< Geometry > MakeFillPath(const flutter::DlPath &path, std::optional< Rect > inner_rect=std::nullopt)
static Scalar ComputeStrokeAlphaCoverage(const Matrix &entity, Scalar stroke_width)
Compute an alpha value to simulate lower coverage of fractional pixel strokes.
virtual GeometryResult::Mode GetResultMode() const
static std::unique_ptr< Geometry > MakeRect(const Rect &rect)
static std::unique_ptr< Geometry > MakeFilledArc(const Rect &oval_bounds, Degrees start, Degrees sweep, bool include_center)
static std::unique_ptr< Geometry > MakeStrokePath(const flutter::DlPath &path, const StrokeParameters &stroke={})
static std::unique_ptr< Geometry > MakeCircle(const Point ¢er, Scalar radius)
virtual bool CanApplyMaskFilter() const
static std::unique_ptr< Geometry > MakeRoundRect(const Rect &rect, const Size &radii)
static GeometryResult ComputePositionGeometry(const ContentContext &renderer, const Tessellator::VertexGenerator &generator, const Entity &entity, RenderPass &pass)
virtual bool CoversArea(const Matrix &transform, const Rect &rect) const
Determines if this geometry, transformed by the given transform, will completely cover all surface ar...
static std::unique_ptr< Geometry > MakeLine(const Point &p0, const Point &p1, const StrokeParameters &stroke)
static std::unique_ptr< Geometry > MakeOval(const Rect &rect)
static std::unique_ptr< Geometry > MakeStrokedCircle(const Point ¢er, Scalar radius, Scalar stroke_width)
static std::unique_ptr< Geometry > MakeRoundSuperellipse(const Rect &rect, Scalar corner_radius)
static std::unique_ptr< Geometry > MakeCover()
static std::unique_ptr< Geometry > MakeStrokedArc(const Rect &oval_bounds, Degrees start, Degrees sweep, const StrokeParameters &stroke)
virtual bool IsAxisAlignedRect() const
BufferView Emplace(const BufferType &buffer, size_t alignment=0)
Emplace non-uniform data (like contiguous vertices) onto the host buffer.
Render passes encode render commands directed as one specific render target into an underlying comman...
An object which produces a list of vertices as |Point|s that tessellate a previously provided shape a...
virtual size_t GetVertexCount() const =0
Returns the number of vertices that the generator plans to produce, if known.
virtual PrimitiveType GetTriangleType() const =0
Returns the |PrimitiveType| that describes the relationship among the list of vertices produced by th...
virtual void GenerateVertices(const TessellatedVertexProc &proc) const =0
Generate the vertices and deliver them in the necessary order (as required by the PrimitiveType) to t...
@ kNone
Does not use the index buffer.
static constexpr Scalar kMinStrokeSize
@ kNormal
The geometry has no overlapping triangles.
A 4x4 matrix using column-major storage.
A structure to store all of the parameters related to stroking a path or basic geometry object.