16 : center_(center), radius_(radius), stroke_width_(-1.0f) {
17 FML_DCHECK(radius >= 0);
27 stroke_width_(
std::max(stroke_width, 0.0f)) {
28 FML_DCHECK(radius >= 0);
29 FML_DCHECK(stroke_width >= 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 {
58 Scalar half_width = stroke_width_ < 0 ? 0.0 : stroke_width_ * 0.5f;
59 Scalar outer_radius = radius_ + half_width;
61 +outer_radius, +outer_radius)
67 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...
A 4x4 matrix using column-major storage.
constexpr TRect< T > Shift(T dx, T dy) const
Returns a new rectangle translated by the given offset.
constexpr static TRect MakeLTRB(Type left, Type top, Type right, Type bottom)