20 padding_pixels_(0.0f) {
31 stroke_width_(
std::max(stroke_width, 0.0f)),
32 padding_pixels_(0.0) {
39 if (stroke_width_ < 0) {
58 padding_pixels_ = extra_padding;
62 return padding_pixels_;
71 Scalar expansion = max_basis == 0 ? 0.0 : padding_pixels_ / max_basis;
73 if (stroke_width_ < 0) {
83 transform, center_, radius_, half_width + expansion);
90 Scalar expansion = max_basis == 0 ? 0.0 : padding_pixels_ / max_basis;
92 Scalar half_width = stroke_width_ < 0 ? 0.0 : stroke_width_ * 0.5f;
93 Scalar outer_radius = radius_ + half_width + expansion;
99 const IRect& rect)
const {
Scalar ComputeAlphaCoverage(const Matrix &transform) const override
Scalar GetAntialiasPadding() const
bool CoversArea(const Matrix &transform, const IRect &rect) const override
Determines if this geometry, transformed by the given transform, will completely cover all of the pix...
GeometryResult GetPositionBuffer(const ContentContext &renderer, const Entity &entity, RenderPass &pass) const override
bool IsAxisAlignedRect() const override
CircleGeometry(const Point ¢er, Scalar radius)
void SetAntialiasPadding(Scalar extra_pixels)
std::optional< Rect > GetCoverage(const Matrix &transform) const override
The coverage rectangle of this geometry, transformed by the transform argument.
~CircleGeometry() override
Scalar GetStrokeWidth() const
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 FilledCircle(const Matrix &view_transform, const Point ¢er, Scalar radius)
Create a |VertexGenerator| that can produce vertices for a filled circle of the given radius around t...
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...
#define FML_DCHECK(condition)
A 4x4 matrix using column-major storage.
Scalar GetMaxBasisLengthXY() const
Return the maximum scale applied specifically to either the X axis or Y axis unit vectors (the bases)...
static constexpr TRect MakeCircleBounds(const TPoint< Type > ¢er, Type radius)
constexpr TRect TransformAndClipBounds(const Matrix &transform) const
Creates a new bounding box that contains this transformed rectangle, clipped against the near clippin...