 |
Flutter Impeller
|
|
Go to the documentation of this file.
29 using VT = SolidFillVertexShader::PerVertexData;
38 count *
sizeof(VT),
alignof(VT),
39 [&generator](uint8_t* buffer) {
40 auto vertices =
reinterpret_cast<VT*
>(buffer);
46 FML_DCHECK(vertices ==
reinterpret_cast<VT*
>(buffer) +
49 .vertex_count = count,
62 std::optional<Rect> inner_rect) {
63 return std::make_shared<FillPathGeometry>(path, inner_rect);
69 return std::make_shared<PointFieldGeometry>(std::move(points), radius, round);
78 if (miter_limit < 0) {
81 return std::make_shared<StrokePathGeometry>(path,
stroke_width, miter_limit,
82 stroke_cap, stroke_join);
86 return std::make_shared<CoverGeometry>();
90 return std::make_shared<RectGeometry>(rect);
94 return std::make_shared<EllipseGeometry>(rect);
101 return std::make_shared<LineGeometry>(p0, p1, width, cap);
106 return std::make_shared<CircleGeometry>(center, radius);
112 return std::make_shared<CircleGeometry>(center, radius,
stroke_width);
117 return std::make_shared<RoundRectGeometry>(rect, radii);
@ kNormal
The geometry has no overlapping triangles.
Matrix GetShaderTransform(const RenderPass &pass) const
Get the vertex shader transform used for drawing this Entity.
BufferView Emplace(const BufferType &buffer, size_t alignment=0)
Emplace non-uniform data (like contiguous vertices) onto the host buffer.
static std::shared_ptr< Geometry > MakePointField(std::vector< Point > points, Scalar radius, bool round)
static std::shared_ptr< Geometry > MakeStrokedCircle(const Point ¢er, Scalar radius, Scalar stroke_width)
static std::shared_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::shared_ptr< Geometry > MakeRoundRect(const Rect &rect, const Size &radii)
virtual bool CanApplyMaskFilter() const
virtual bool IsAxisAlignedRect() const
virtual GeometryResult::Mode GetResultMode() const
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...
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...
const Scalar stroke_width
static std::shared_ptr< Geometry > MakeOval(const Rect &rect)
static GeometryResult ComputePositionGeometry(const ContentContext &renderer, const Tessellator::VertexGenerator &generator, const Entity &entity, RenderPass &pass)
static std::shared_ptr< Geometry > MakeFillPath(const Path &path, std::optional< Rect > inner_rect=std::nullopt)
An object which produces a list of vertices as |Point|s that tessellate a previously provided shape a...
Paths are lightweight objects that describe a collection of linear, quadratic, or cubic segments....
@ kNone
Does not use the index buffer.
Render passes encode render commands directed as one specific render target into an underlying comman...
static std::shared_ptr< Geometry > MakeRect(const Rect &rect)
virtual PrimitiveType GetTriangleType() const =0
Returns the |PrimitiveType| that describes the relationship among the list of vertices produced by th...
virtual size_t GetVertexCount() const =0
Returns the number of vertices that the generator plans to produce, if known.
static std::shared_ptr< Geometry > MakeCircle(const Point ¢er, Scalar radius)
A 4x4 matrix using column-major storage.
HostBuffer & GetTransientsBuffer() const
Retrieve the currnent host buffer for transient storage.
static std::shared_ptr< Geometry > MakeCover()
static std::shared_ptr< Geometry > MakeLine(const Point &p0, const Point &p1, Scalar width, Cap cap)