28 using VT = SolidFillVertexShader::PerVertexData;
37 count *
sizeof(VT),
alignof(VT),
38 [&generator](uint8_t* buffer) {
39 auto vertices =
reinterpret_cast<VT*
>(buffer);
45 FML_DCHECK(vertices ==
reinterpret_cast<VT*
>(buffer) +
48 .vertex_count = count,
61 std::optional<Rect> inner_rect) {
62 return std::make_unique<FillPathGeometry>(path, inner_rect);
71 if (miter_limit < 0) {
74 return std::make_unique<StrokePathGeometry>(path,
stroke_width, miter_limit,
75 stroke_cap, stroke_join);
79 return std::make_unique<CoverGeometry>();
83 return std::make_unique<RectGeometry>(rect);
87 return std::make_unique<EllipseGeometry>(rect);
94 return std::make_unique<LineGeometry>(p0, p1, width, cap);
99 return std::make_unique<CircleGeometry>(center, radius);
105 return std::make_unique<CircleGeometry>(center, radius,
stroke_width);
110 return std::make_unique<RoundRectGeometry>(rect, radii);
129 if (scaled_stroke_width == 0.0 || scaled_stroke_width >=
kMinStrokeSize) {
133 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
Get the vertex shader transform used for drawing this Entity.
static std::unique_ptr< Geometry > MakeStrokePath(const Path &path, Scalar stroke_width=0.0, Scalar miter_limit=4.0, Cap stroke_cap=Cap::kButt, Join stroke_join=Join::kMiter)
static std::unique_ptr< Geometry > MakeFillPath(const Path &path, std::optional< Rect > inner_rect=std::nullopt)
static std::unique_ptr< Geometry > MakeLine(const Point &p0, const Point &p1, Scalar width, Cap cap)
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 > 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 > MakeOval(const Rect &rect)
static std::unique_ptr< Geometry > MakeStrokedCircle(const Point ¢er, Scalar radius, Scalar stroke_width)
static std::unique_ptr< Geometry > MakeCover()
virtual bool IsAxisAlignedRect() const
BufferView Emplace(const BufferType &buffer, size_t alignment=0)
Emplace non-uniform data (like contiguous vertices) onto the host buffer.
Paths are lightweight objects that describe a collection of linear, quadratic, or cubic segments....
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
const Scalar stroke_width
@ kNormal
The geometry has no overlapping triangles.
A 4x4 matrix using column-major storage.