5 #ifndef FLUTTER_IMPELLER_GEOMETRY_ROUND_RECT_H_
6 #define FLUTTER_IMPELLER_GEOMETRY_ROUND_RECT_H_
57 [[nodiscard]] constexpr
bool IsFinite()
const {
67 [[nodiscard]] constexpr
bool IsRect()
const {
71 [[nodiscard]] constexpr
bool IsOval()
const {
128 return bounds_ == rr.bounds_ && radii_ == rr.radii_;
132 return !(*
this == r);
137 : bounds_(bounds), radii_(radii) {}
140 RoundingRadii radii_;
143 void Dispatch(PathReceiver& receiver)
const;
const RoundRect & GetInner() const
DiffRoundRectPathSource(const RoundRect &outer, const RoundRect &inner)
~DiffRoundRectPathSource()
Rect GetBounds() const override
bool IsConvex() const override
void Dispatch(PathReceiver &receiver) const override
FillType GetFillType() const override
const RoundRect & GetOuter() const
Collection of functions to receive path segments from the underlying path representation via the DlPa...
RoundRectPathSource(const RoundRect &round_rect)
Rect GetBounds() const override
bool IsConvex() const override
void Dispatch(PathReceiver &receiver) const override
const RoundRect & GetRoundRect() const
FillType GetFillType() const override
constexpr bool ScalarNearlyEqual(Scalar x, Scalar y, Scalar tolerance=kEhCloseEnough)
std::ostream & operator<<(std::ostream &out, const impeller::Arc &a)
constexpr bool IsFinite() const
static RoundRect MakeRectRadius(const Rect &rect, Scalar radius)
constexpr const RoundingRadii & GetRadii() const
static RoundRect MakeRectRadii(const Rect &rect, const RoundingRadii &radii)
RoundRect Expand(Scalar amount) const
Returns a round rectangle with expanded edges. Negative expansion results in shrinking.
static RoundRect MakeNinePatch(const Rect &rect, Scalar left, Scalar top, Scalar right, Scalar bottom)
constexpr bool IsEmpty() const
constexpr bool operator==(const RoundRect &rr) const
static RoundRect MakeOval(const Rect &rect)
static RoundRect MakeRectXY(const Rect &rect, Scalar x_radius, Scalar y_radius)
constexpr bool IsRect() const
RoundRect Expand(Scalar left, Scalar top, Scalar right, Scalar bottom) const
Returns a round rectangle with expanded edges. Negative expansion results in shrinking.
static RoundRect MakeRectXY(const Rect &rect, Size corner_radii)
constexpr bool operator!=(const RoundRect &r) const
bool Contains(const Point &p) const
Returns true iff the provided point |p| is inside the half-open interior of this rectangle.
RoundRect Expand(Scalar horizontal, Scalar vertical) const
Returns a round rectangle with expanded edges. Negative expansion results in shrinking.
constexpr const Rect & GetBounds() const
constexpr bool IsOval() const
static RoundRect MakeRect(const Rect &rect)
RoundRect Shift(Scalar dx, Scalar dy) const
Returns a new round rectangle translated by the given offset.
constexpr static RoundingRadii MakeNinePatch(Scalar left, Scalar top, Scalar right, Scalar bottom)
constexpr bool AreAllCornersEmpty() const
constexpr static RoundingRadii MakeRadii(Size radii)
constexpr bool AreAllCornersSame(Scalar tolerance=kEhCloseEnough) const
constexpr static RoundingRadii MakeRadius(Scalar radius)
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 Type GetHeight() const
Returns the height of the rectangle, equivalent to |GetSize().height|.
constexpr bool IsEmpty() const
Returns true if either of the width or height are 0, negative, or NaN.
constexpr TSize< Type > GetSize() const
Returns the size of the rectangle which may be negative in either width or height and may have been c...
IsFinite() const
Returns true if all of the fields of this floating point rectangle are finite.
constexpr TRect< T > Shift(T dx, T dy) const
Returns a new rectangle translated by the given offset.
constexpr Type GetWidth() const
Returns the width of the rectangle, equivalent to |GetSize().width|.