8#ifndef skgpu_graphite_geom_Rect_DEFINED
9#define skgpu_graphite_geom_Rect_DEFINED
16#define AI SK_ALWAYS_INLINE
32 AI Rect(
float l,
float t,
float r,
float b) : fVals(NegateBotRight({l,t,r,
b})) {}
74 AI float x()
const {
return fVals.x(); }
75 AI float y()
const {
return fVals.y(); }
76 AI float left()
const {
return fVals.x(); }
77 AI float top()
const {
return fVals.y(); }
78 AI float right()
const {
return -fVals.z(); }
79 AI float bot()
const {
return -fVals.w(); }
98 skvx::cast<int>(this->
ltrb()).store(&rect);
103 return !
all(fVals.xy() + fVals.zw() < 0);
111 return p.xy() +
p.zw();
115 float2 negativeSize = fVals.xy() + fVals.zw();
116 return negativeSize.x() * negativeSize.y();
157 return sk_bit_cast<float4>(sk_bit_cast<uint4>(
vals) ^
uint4(0, 0, 1u << 31, 1u << 31));
constexpr float SK_FloatInfinity
constexpr float SK_FloatNegativeInfinity
static AI Rect XYWH(float2 topLeft, float2 size)
AI void setBot(float bot)
static AI Rect InfiniteInverted()
static AI Rect XYWH(float x, float y, float w, float h)
AI bool contains(Rect rect) const
AI void setTop(float top)
AI Rect makeIntersect(Rect rect) const
AI Rect makeOutset(float2 outset) const
AI Rect makeRoundIn() const
AI Rect & inset(float inset)
static AI Rect WH(float2 size)
AI bool isEmptyNegativeOrNaN() const
AI Rect makeOutset(float outset) const
static AI Rect LTRB(float4 ltrb)
static AI Rect WH(float w, float h)
AI void setTopLeft(float2 topLeft)
static AI Rect Infinite()
AI Rect makeInset(float2 inset) const
AI Rect makeSorted() const
AI const float4 & vals() const
AI SkRect asSkRect() const
AI Rect & inset(float2 inset)
AI Rect & offset(float2 offset)
AI float2 topLeft() const
AI Rect & join(Rect rect)
AI bool operator!=(Rect rect) const
AI Rect makeInset(float inset) const
AI bool operator==(Rect rect) const
static AI Rect FromVals(float4 vals)
AI bool intersects(ComplementRect comp) const
AI Rect & outset(float2 outset)
AI void setLeft(float left)
AI Rect & intersect(Rect rect)
AI Rect makeJoin(Rect rect) const
AI float2 botRight() const
AI Rect makeOffset(float2 offset) const
AI SkIRect asSkIRect() const
static AI Rect Point(float2 p)
AI Rect makeRoundOut() const
AI Rect(float l, float t, float r, float b)
AI Rect(float2 topLeft, float2 botRight)
AI void setRight(float right)
AI void setBotRight(float2 botRight)
AI Rect & outset(float outset)
static float max(float r, float g, float b)
static float min(float r, float g, float b)
sk_sp< SkBlender > blender SkRect rect
SIT bool all(const Vec< 1, T > &x)
SIN Vec< N, float > floor(const Vec< N, float > &x)
SIT bool any(const Vec< 1, T > &x)
SIN Vec< N, float > ceil(const Vec< N, float > &x)
AI ComplementRect(Rect rect)
SKVX_ALWAYS_INLINE void store(void *ptr) const