#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 |
| virtual bool | CoversArea (const Matrix &transform, const Rect &rect) const |
Determines if this geometry, transformed by the given transform, will completely cover all surface area of the given rect. More... | |
| 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 Path &path, std::optional< Rect > inner_rect=std::nullopt) |
| 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 > | 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, Scalar width, Cap cap) |
| 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 > | 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. More... | |
| 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::CoverGeometry.
Definition at line 129 of file geometry.cc.
|
inlinevirtual |
Reimplemented in impeller::StrokePathGeometry, impeller::LineGeometry, and impeller::CircleGeometry.
Definition at line 118 of file geometry.h.
Referenced by impeller::ColorSourceContents::AppliesAlphaForStrokeCoverage(), impeller::SolidColorContents::Render(), and impeller::TiledTextureContents::Render().
|
static |
Definition at line 25 of file geometry.cc.
References impeller::HostBuffer::Emplace(), impeller::Tessellator::VertexGenerator::GenerateVertices(), impeller::Entity::GetShaderTransform(), impeller::ContentContext::GetTransientsBuffer(), impeller::Tessellator::VertexGenerator::GetTriangleType(), impeller::Tessellator::VertexGenerator::GetVertexCount(), impeller::kNone, and impeller::GeometryResult::type.
|
static |
Compute an alpha value to simulate lower coverage of fractional pixel strokes.
Definition at line 134 of file geometry.cc.
References impeller::kMinStrokeSize, stroke_width, and transform.
Referenced by impeller::CircleGeometry::ComputeAlphaCoverage(), impeller::LineGeometry::ComputeAlphaCoverage(), and impeller::StrokePathGeometry::ComputeAlphaCoverage().
Determines if this geometry, transformed by the given transform, will completely cover all surface area of the given rect.
This is a conservative estimate useful for certain optimizations.
true if the transformed geometry is guaranteed to cover the given rect. May return false in many undetected cases where the transformed geometry does in fact cover the rect. Reimplemented in impeller::SuperellipseGeometry, impeller::RoundSuperellipseGeometry, impeller::RoundRectGeometry, impeller::RectGeometry, impeller::LineGeometry, impeller::FillPathGeometry, impeller::EllipseGeometry, impeller::CoverGeometry, and impeller::CircleGeometry.
Definition at line 121 of file geometry.cc.
Referenced by impeller::SolidColorContents::AsBackgroundColor().
|
pure virtual |
Implemented in impeller::RectGeometry, impeller::PointFieldGeometry, impeller::LineGeometry, and impeller::DlVerticesGeometry.
Referenced by impeller::Canvas::ClipGeometry(), impeller::ColorSourceContents::DrawGeometry(), impeller::ColorSourceContents::GetCoverage(), impeller::SolidColorContents::GetCoverage(), and impeller::TiledTextureContents::RenderToSnapshot().
|
pure virtual |
|
virtual |
Definition at line 57 of file geometry.cc.
References impeller::GeometryResult::kNormal.
Referenced by impeller::ColorSourceContents::DrawGeometry().
|
virtual |
Reimplemented in impeller::SuperellipseGeometry, impeller::RoundSuperellipseGeometry, impeller::RoundRectGeometry, impeller::RectGeometry, impeller::LineGeometry, impeller::EllipseGeometry, and impeller::CircleGeometry.
Definition at line 125 of file geometry.cc.
Referenced by impeller::Canvas::ClipGeometry().
|
static |
Definition at line 99 of file geometry.cc.
|
static |
Definition at line 80 of file geometry.cc.
Referenced by impeller::testing::TEST_P().
|
static |
Definition at line 61 of file geometry.cc.
Referenced by impeller::testing::TEST(), and impeller::testing::TEST_P().
|
static |
Definition at line 92 of file geometry.cc.
Referenced by impeller::testing::TEST().
Definition at line 88 of file geometry.cc.
Definition at line 84 of file geometry.cc.
Referenced by impeller::Canvas::DrawVertices(), impeller::testing::TEST(), and impeller::testing::TEST_P().
|
static |
Definition at line 110 of file geometry.cc.
Referenced by impeller::testing::TEST().
|
static |
Definition at line 115 of file geometry.cc.
|
static |
Definition at line 104 of file geometry.cc.
References stroke_width.
|
static |
Definition at line 67 of file geometry.cc.
References stroke_width.
Referenced by impeller::testing::TEST(), and impeller::testing::TEST_P().