 |
Flutter Impeller
|
|
Go to the documentation of this file.
5 #ifndef FLUTTER_IMPELLER_ENTITY_GEOMETRY_GEOMETRY_H_
6 #define FLUTTER_IMPELLER_ENTITY_GEOMETRY_GEOMETRY_H_
12 #include "impeller/entity/texture_fill.vert.h"
59 VertexBufferBuilder<TextureFillVertexShader::PerVertexData>
61 VertexBufferBuilder<SolidFillVertexShader::PerVertexData>& input,
63 Size texture_coverage,
64 Matrix effect_transform);
78 Matrix effect_transform,
79 const ContentContext& renderer,
87 std::optional<Rect> inner_rect = std::nullopt);
96 static std::shared_ptr<Geometry>
MakeCover();
98 static std::shared_ptr<Geometry>
MakeRect(
const Rect& rect);
100 static std::shared_ptr<Geometry>
MakeOval(
const Rect& rect);
117 static std::shared_ptr<Geometry>
MakePointField(std::vector<Point> points,
163 const Matrix& uv_transform,
170 #endif // FLUTTER_IMPELLER_ENTITY_GEOMETRY_GEOMETRY_H_
@ kNormal
The geometry has no overlapping triangles.
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 std::optional< Rect > GetCoverage(const Matrix &transform) const =0
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...
const Scalar stroke_width
VertexBufferBuilder< TextureFillVertexShader::PerVertexData > ComputeUVGeometryCPU(VertexBufferBuilder< SolidFillVertexShader::PerVertexData > &input, Point texture_origin, Size texture_coverage, Matrix effect_transform)
Compute UV geometry for a VBB that contains only position geometry.
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...
PrimitiveType
Decides how backend draws pixels based on input vertices.
virtual GeometryResult GetPositionBuffer(const ContentContext &renderer, const Entity &entity, RenderPass &pass) const =0
Paths are lightweight objects that describe a collection of linear, quadratic, or cubic segments....
static GeometryResult ComputePositionUVGeometry(const ContentContext &renderer, const Tessellator::VertexGenerator &generator, const Matrix &uv_transform, const Entity &entity, RenderPass &pass)
virtual GeometryResult GetPositionUVBuffer(Rect texture_coverage, Matrix effect_transform, const ContentContext &renderer, const Entity &entity, RenderPass &pass) const =0
@ kNone
Does not use the index buffer.
virtual GeometryVertexType GetVertexType() const =0
Render passes encode render commands directed as one specific render target into an underlying comman...
static std::shared_ptr< Geometry > MakeRect(const Rect &rect)
static const GeometryResult kEmptyResult
GeometryResult ComputeUVGeometryForRect(Rect source_rect, Rect texture_bounds, Matrix effect_transform, const ContentContext &renderer, const Entity &entity, RenderPass &pass)
Computes geometry and UV coordinates for a rectangle to be rendered.
static std::shared_ptr< Geometry > MakeCircle(const Point ¢er, Scalar radius)
VertexBuffer vertex_buffer
A 4x4 matrix using column-major storage.
static std::shared_ptr< Geometry > MakeCover()
static std::shared_ptr< Geometry > MakeLine(const Point &p0, const Point &p1, Scalar width, Cap cap)