32 const Point& direction,
34 FML_DCHECK(radii.
width >= 0.0f && radii.
height >= 0.0f);
42 Point corner_relative = (corner - p) * direction;
51 Point quadrant_relative = radii - corner_relative;
52 if (quadrant_relative.
x <= 0.0f || quadrant_relative.
y <= 0.0f) {
62 Point quadrant_unit_circle_point = quadrant_relative / radii;
125 : round_rect_(round_rect) {}
142 round_rect_.Dispatch(receiver);
147 : outer_(outer), inner_(inner) {}
164 outer_.Dispatch(receiver);
165 inner_.Dispatch(receiver);
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
Collection of functions to receive path segments from the underlying path representation via the DlPa...
virtual void LineTo(const Point &p2)=0
virtual void MoveTo(const Point &p2, bool will_be_closed)=0
virtual bool ConicTo(const Point &cp, const Point &p2, Scalar weight)
RoundRectPathSource(const RoundRect &round_rect)
Rect GetBounds() const override
bool IsConvex() const override
void Dispatch(PathReceiver &receiver) const override
FillType GetFillType() const override
constexpr float kSqrt2Over2
static bool CornerContains(const Point &p, const Point &corner, const Point &direction, const Size &radii)
static constexpr Point kUpperLeftDirection(-1.0f, -1.0f)
static constexpr Point kLowerRightDirection(1.0f, 1.0f)
static constexpr Point kUpperRightDirection(1.0f, -1.0f)
static constexpr Point kLowerLeftDirection(-1.0f, 1.0f)
static RoundRect MakeRectRadii(const Rect &rect, const RoundingRadii &radii)
bool Contains(const Point &p) const
Returns true iff the provided point |p| is inside the half-open interior of this rectangle.
constexpr const Rect & GetBounds() const
RoundingRadii Scaled(const Rect &bounds) const
Returns a scaled copy of this object, ensuring that the sum of the corner radii on each side does not...
constexpr Type GetLengthSquared() const
constexpr auto GetBottom() const
constexpr auto GetTop() const
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 auto GetLeft() const
constexpr TRect GetPositive() const
Get a version of this rectangle that has a non-negative size.
constexpr auto GetRight() const
IsFinite() const
Returns true if all of the fields of this floating point rectangle are finite.
constexpr TPoint< T > GetLeftBottom() const
constexpr TPoint< T > GetRightTop() const
constexpr TPoint< T > GetRightBottom() const
constexpr TPoint< T > GetLeftTop() const
constexpr bool IsEmpty() const
Returns true if either of the width or height are 0, negative, or NaN.