#include <geometry.h>
Public Member Functions | |
| virtual | ~Geometry () |
| virtual GeometryResult | GetPositionBuffer (const ContentContext &renderer, const Entity &entity, RenderPass &pass) const =0 |
| virtual GeometryResult::Mode | GetResultMode () const |
| virtual std::optional< Rect > | GetCoverage (const Matrix &transform) const =0 |
The coverage rectangle of this geometry, transformed by the transform argument. | |
| virtual bool | CoversArea (const Matrix &transform, const IRect &rect) const |
Determines if this geometry, transformed by the given transform, will completely cover all of the pixels within the given integer rect. | |
| virtual bool | IsAxisAlignedRect () const |
| virtual bool | CanApplyMaskFilter () const |
| virtual Scalar | ComputeAlphaCoverage (const Matrix &transform) const |
Static Public Member Functions | |
| static std::unique_ptr< Geometry > | MakeFillPath (const flutter::DlPath &path, std::optional< Rect > inner_rect=std::nullopt) |
| static std::unique_ptr< Geometry > | MakeStrokePath (const flutter::DlPath &path, const StrokeParameters &stroke={}) |
| static std::unique_ptr< Geometry > | MakeCover () |
| static std::unique_ptr< Geometry > | MakeRect (const Rect &rect) |
| static std::unique_ptr< Geometry > | MakeOval (const Rect &rect) |
| static std::unique_ptr< Geometry > | MakeLine (const Point &p0, const Point &p1, const StrokeParameters &stroke) |
| static std::unique_ptr< Geometry > | MakeCircle (const Point ¢er, Scalar radius) |
| static std::unique_ptr< Geometry > | MakeStrokedCircle (const Point ¢er, Scalar radius, Scalar stroke_width) |
| static std::unique_ptr< Geometry > | MakeFilledArc (const Rect &oval_bounds, Degrees start, Degrees sweep, bool include_center) |
| static std::unique_ptr< Geometry > | MakeStrokedArc (const Rect &oval_bounds, Degrees start, Degrees sweep, const StrokeParameters &stroke) |
| static std::unique_ptr< Geometry > | MakeRoundRect (const Rect &rect, const Size &radii) |
| static std::unique_ptr< Geometry > | MakeRoundSuperellipse (const Rect &rect, Scalar corner_radius) |
| static Scalar | ComputeStrokeAlphaCoverage (const Matrix &entity, Scalar stroke_width) |
| Compute an alpha value to simulate lower coverage of fractional pixel strokes. | |
| static GeometryResult | ComputePositionGeometry (const ContentContext &renderer, const Tessellator::VertexGenerator &generator, const Entity &entity, RenderPass &pass) |
Definition at line 50 of file geometry.h.
|
inlinevirtual |
Definition at line 52 of file geometry.h.
|
virtual |
Reimplemented in impeller::DlVerticesGeometry, and impeller::CoverGeometry.
Definition at line 144 of file geometry.cc.
|
inlinevirtual |
Reimplemented in impeller::ArcGeometry, impeller::CircleGeometry, impeller::LineGeometry, and impeller::StrokeSegmentsGeometry.
Definition at line 135 of file geometry.h.
Referenced by impeller::ColorSourceContents::AppliesAlphaForStrokeCoverage(), impeller::SolidColorContents::Render(), and impeller::TiledTextureContents::Render().
|
static |
Definition at line 26 of file geometry.cc.
References impeller::HostBuffer::Emplace(), FML_DCHECK, impeller::Tessellator::VertexGenerator::GenerateVertices(), impeller::Entity::GetShaderTransform(), impeller::ContentContext::GetTransientsDataBuffer(), impeller::Tessellator::VertexGenerator::GetTriangleType(), impeller::Tessellator::VertexGenerator::GetVertexCount(), impeller::kNone, and impeller::GeometryResult::type.
Referenced by impeller::CircleGeometry::GetPositionBuffer().
|
static |
Compute an alpha value to simulate lower coverage of fractional pixel strokes.
Definition at line 149 of file geometry.cc.
References impeller::kMinStrokeSize, and transform.
Referenced by impeller::ArcGeometry::ComputeAlphaCoverage(), impeller::CircleGeometry::ComputeAlphaCoverage(), impeller::LineGeometry::ComputeAlphaCoverage(), and impeller::StrokeSegmentsGeometry::ComputeAlphaCoverage().
Determines if this geometry, transformed by the given transform, will completely cover all of the pixels within the given integer rect.
The integer rect, by definition, will contain all of the area covered by any pixel within its boundary.
The return value can be a conservative estimate which will still be useful for certain optimizations. It may return false for obscure cases that might actually contain all of the pixels if it is too computationally costly to prove containment, but it should never return 'true' unless the implementation can prove that all pixels are fully covered (rendered) by the geometry.
true if the transformed geometry is guaranteed to cover the given rect. May return false in some cases where the transformed geometry does in fact cover the rect. Reimplemented in impeller::ArcGeometry, impeller::CircleGeometry, impeller::CoverGeometry, impeller::EllipseGeometry, impeller::FillPathSourceGeometry, impeller::LineGeometry, impeller::FillRectGeometry, impeller::RoundRectGeometry, impeller::FillRoundRectGeometry, impeller::RoundSuperellipseGeometry, impeller::SuperellipseGeometry, and impeller::UberSDFGeometry.
Definition at line 136 of file geometry.cc.
Referenced by impeller::SolidColorContents::AsBackgroundColor(), and impeller::UberSDFContents::AsBackgroundColor().
|
pure virtual |
The coverage rectangle of this geometry, transformed by the transform argument.
Implemented in impeller::DlVerticesGeometry, impeller::CircleGeometry, impeller::LineGeometry, impeller::PointFieldGeometry, impeller::FillRectGeometry, impeller::StrokeRectGeometry, impeller::StrokePathSourceGeometry, impeller::ArcStrokeGeometry, and impeller::UberSDFGeometry.
Referenced by impeller::Canvas::ClipGeometry(), impeller::ColorSourceContents::DrawGeometry(), impeller::ColorSourceContents::GetCoverage(), impeller::SolidColorContents::GetCoverage(), impeller::UberSDFContents::GetCoverage(), and impeller::TiledTextureContents::RenderToSnapshot().
|
pure virtual |
Implemented in impeller::DlVerticesGeometry, impeller::CircleGeometry, impeller::FillRectGeometry, impeller::StrokeRectGeometry, and impeller::UberSDFGeometry.
Referenced by impeller::Canvas::ClipGeometry(), impeller::ColorSourceContents::DefaultCreateGeometryCallback(), impeller::ColorSourceContents::DrawGeometry(), and impeller::UberSDFContents::Render().
|
virtual |
Definition at line 58 of file geometry.cc.
References impeller::GeometryResult::kNormal.
Referenced by impeller::ColorSourceContents::DrawGeometry().
|
virtual |
Reimplemented in impeller::ArcGeometry, impeller::CircleGeometry, impeller::EllipseGeometry, impeller::LineGeometry, impeller::FillRectGeometry, impeller::RoundRectGeometry, impeller::RoundSuperellipseGeometry, impeller::SuperellipseGeometry, and impeller::UberSDFGeometry.
Definition at line 140 of file geometry.cc.
Referenced by impeller::Canvas::ClipGeometry().
|
static |
Definition at line 97 of file geometry.cc.
Referenced by impeller::testing::TEST().
|
static |
Definition at line 79 of file geometry.cc.
Referenced by impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), and impeller::testing::TEST_P().
|
static |
Definition at line 108 of file geometry.cc.
References start.
Referenced by impeller::testing::TEST().
|
static |
Definition at line 62 of file geometry.cc.
Referenced by impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), and impeller::testing::TEST_P().
|
static |
Definition at line 91 of file geometry.cc.
References p1.
Referenced by impeller::testing::TEST().
Definition at line 87 of file geometry.cc.
Definition at line 83 of file geometry.cc.
Referenced by impeller::Canvas::DrawVertices(), impeller::testing::TEST(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), and impeller::testing::TEST_P().
|
static |
Definition at line 125 of file geometry.cc.
Referenced by impeller::testing::TEST().
|
static |
Definition at line 130 of file geometry.cc.
Referenced by impeller::testing::TEST_P(), impeller::testing::TEST_P(), and impeller::testing::TEST_P().
|
static |
Definition at line 116 of file geometry.cc.
References start.
Referenced by impeller::testing::TEST(), and impeller::testing::TEST_P().
|
static |
Definition at line 102 of file geometry.cc.
Referenced by impeller::testing::TEST().
|
static |
Definition at line 68 of file geometry.cc.
References impeller::StrokeParameters::miter_limit.
Referenced by impeller::testing::TEST(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), and impeller::testing::TEST_P().