10 : bounds_(bounds), radii_(radii) {}
24 std::optional<Rect> RoundRectGeometry::GetCoverage(
30 const Rect& rect)
const {
31 if (!
transform.IsTranslationScaleOnly()) {
36 if (!flat_on_tb && !flat_on_lr) {
70 return round_rect_source_;
74 const Rect& rect)
const {
77 if (!
transform.IsTranslationScaleOnly()) {
92 bool flat_on_tb = bounds.
GetWidth() > left_margin + right_margin;
93 bool flat_on_lr = bounds.
GetHeight() > top_margin + bottom_margin;
94 if (!flat_on_tb && !flat_on_lr) {
104 Rect vertical_bounds = bounds.
Expand(-left_margin, 0, -right_margin, 0);
111 Rect horizontal_bounds = bounds.
Expand(0, -top_margin, 0, -bottom_margin);
126 return round_rect_source_;
Tessellator & GetTessellator() const
const Matrix & GetTransform() const
Get the global transform matrix for this Entity.
An abstract Geometry base class that produces fillable vertices for the interior of any |PathSource| ...
const PathSource & GetSource() const override
FillRoundRectGeometry(const RoundRect &round_rect)
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...
static GeometryResult ComputePositionGeometry(const ContentContext &renderer, const Tessellator::VertexGenerator &generator, const Entity &entity, RenderPass &pass)
Render passes encode render commands directed as one specific render target into an underlying comman...
~RoundRectGeometry() override
RoundRectGeometry(const Rect &bounds, const Size &radii)
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
const RoundRect & GetRoundRect() const
An abstract Geometry base class that produces fillable vertices representing the stroked outline from...
StrokeRoundRectGeometry(const RoundRect &rect, const StrokeParameters ¶meters)
const PathSource & GetSource() const override
EllipticalVertexGenerator FilledRoundRect(const Matrix &view_transform, const Rect &bounds, const Size &radii)
Create a |VertexGenerator| that can produce vertices for a filled round rect within the given bounds ...
A 4x4 matrix using column-major storage.
constexpr const RoundingRadii & GetRadii() const
constexpr const Rect & GetBounds() const
A structure to store all of the parameters related to stroking a path or basic geometry object.
constexpr TRect< T > Expand(T left, T top, T right, T bottom) const
Returns a rectangle with expanded edges. Negative expansion results in shrinking.
constexpr TRect TransformBounds(const Matrix &transform) const
Creates a new bounding box that contains this transformed rectangle.
constexpr Type GetHeight() const
Returns the height of the rectangle, equivalent to |GetSize().height|.
constexpr bool Contains(const TPoint< Type > &p) const
Returns true iff the provided point |p| is inside the half-open interior of this rectangle.
constexpr Type GetWidth() const
Returns the width of the rectangle, equivalent to |GetSize().width|.