16 : center_(center), radius_(radius), stroke_width_(-1.0f) {
17 FML_DCHECK(radius >= 0);
28 FML_DCHECK(radius >= 0);
34 if (stroke_width_ < 0) {
45 Scalar half_width = stroke_width_ < 0 ? 0.0
57 std::optional<Rect> CircleGeometry::GetCoverage(
const Matrix&
transform)
const {
59 {center_.
x, center_.
y - radius_},
60 {center_.
x + radius_, center_.
y},
61 {center_.
x, center_.
y + radius_},
62 {center_.
x - radius_, center_.
y},
65 for (
int i = 0; i < 4; i++) {
72 const Rect& rect)
const {
Scalar ComputeAlphaCoverage(const Matrix &transform) const 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...
bool IsAxisAlignedRect() const override
CircleGeometry(const Point ¢er, Scalar radius)
~CircleGeometry() override
Tessellator & GetTessellator() const
const Matrix & GetTransform() const
Get the global transform matrix for this Entity.
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)
static Scalar ComputePixelHalfWidth(const Matrix &transform, Scalar width)
Render passes encode render commands directed as one specific render target into an underlying comman...
EllipticalVertexGenerator StrokedCircle(const Matrix &view_transform, const Point ¢er, Scalar radius, Scalar half_width)
Create a |VertexGenerator| that can produce vertices for a stroked circle of the given radius and hal...
const Scalar stroke_width
A 4x4 matrix using column-major storage.
constexpr static std::optional< TRect > MakePointBounds(const U &value)