7 #include "fml/logging.h"
16 std::optional<Rect> inner_rect)
17 : path_(path), inner_rect_(inner_rect) {}
28 if (bounding_box.has_value() && bounding_box->IsEmpty()) {
41 bool supports_primitive_restart =
43 bool supports_triangle_fan =
45 supports_primitive_restart;
48 supports_primitive_restart,
49 supports_triangle_fan);
51 return GeometryResult{
54 .vertex_buffer = std::move(vertex_buffer),
56 .mode = GetResultMode(),
63 (bounding_box.has_value() && bounding_box->IsEmpty())) {
77 std::optional<Rect> FillPathGeometry::GetCoverage(
83 const Rect& rect)
const {
84 if (!inner_rect_.has_value()) {
87 if (!
transform.IsTranslationScaleOnly()) {
virtual bool SupportsTriangleFan() const =0
Whether the primitive type TriangleFan is supported by the backend.
virtual bool SupportsPrimitiveRestart() const =0
Whether primitive restart is supported.
HostBuffer & GetTransientsBuffer() const
Retrieve the currnent host buffer for transient storage.
const Capabilities & GetDeviceCapabilities() const
Tessellator & GetTessellator() const
Matrix GetShaderTransform(const RenderPass &pass) const
Get the vertex shader transform used for drawing this Entity.
const Matrix & GetTransform() const
Get the global transform matrix for this Entity.
~FillPathGeometry() override
bool CoversArea(const Matrix &transform, const Rect &rect) const override
Determines if this geometry, transformed by the given transform, will completely cover all surface ar...
FillPathGeometry(const Path &path, std::optional< Rect > inner_rect=std::nullopt)
Paths are lightweight objects that describe a collection of linear, quadratic, or cubic segments....
FillType GetFillType() const
std::optional< Rect > GetTransformedBoundingBox(const Matrix &transform) const
std::optional< Rect > GetBoundingBox() const
Render passes encode render commands directed as one specific render target into an underlying comman...
const Matrix & GetOrthographicTransform() const
VertexBuffer TessellateConvex(const Path &path, HostBuffer &host_buffer, Scalar tolerance, bool supports_primitive_restart=false, bool supports_triangle_fan=false)
Given a convex path, create a triangle fan structure.
@ kNormal
The geometry has no overlapping triangles.
A 4x4 matrix using column-major storage.
constexpr Scalar GetMaxBasisLengthXY() const
constexpr bool Contains(const TPoint< Type > &p) const
Returns true iff the provided point |p| is inside the half-open interior of this rectangle.