13#define CHECK(A) REPORTER_ASSERT(reporter, A)
25 for (
const float l : {0,1,2}) {
26 for (
const float t : {-4,-3,-2}) {
27 for (
const float r : {3,4,5}) {
28 for (
const float b : {-1,0,1}) {
29 const Rect rect2(l,t,r,
b);
32 CHECK(rect2 == rect2);
43 if (l == 0 && t == 0) {
60 Rect setTest(-99,-99,99,99);
61 CHECK(setTest != rect2);
66 CHECK(setTest == rect2);
68 setTest =
Rect(-99,-99,99,99);
69 CHECK(setTest != rect2);
72 CHECK(setTest == rect2);
74 for (
int i = 0;
i < 4; ++
i) {
77 rnan.
vals()[
i] = std::numeric_limits<float>::quiet_NaN();
83 CHECK(rect2.
area() == skRect2.height() * skRect2.width());
103 CHECK(
rect.intersects(rect2) == !
rect.makeIntersect(rect2).isEmptyNegativeOrNaN());
105 if (
rect.intersects(rect2)) {
112 const Rect rect3{r,
b,l,t};
114 CHECK(rect3.isEmptyNegativeOrNaN());
115 CHECK(skRect3.isEmpty());
116 CHECK(rect3.makeSorted() == skRect3.makeSorted());
117 CHECK(rect3.makeSorted() == rect2);
AI void setBot(float bot)
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 makeRoundIn() const
AI bool isEmptyNegativeOrNaN() const
AI Rect makeOutset(float outset) const
static AI Rect WH(float w, float h)
AI void setTopLeft(float2 topLeft)
AI const float4 & vals() const
AI SkRect asSkRect() const
AI float2 topLeft() const
AI Rect makeInset(float inset) const
static AI Rect FromVals(float4 vals)
AI bool intersects(ComplementRect comp) const
AI void setLeft(float left)
AI Rect makeJoin(Rect rect) const
AI float2 botRight() const
AI Rect makeOffset(float2 offset) const
AI Rect makeRoundOut() const
AI void setRight(float right)
AI void setBotRight(float2 botRight)
sk_sp< SkBlender > blender SkRect rect
DEF_GRAPHITE_TEST(skgpu_IntersectionTree, reporter, CtsEnforcement::kNextRelease)
SIT bool all(const Vec< 1, T > &x)
static SkRect Make(const SkISize &size)
bool intersect(const SkRect &r)
bool intersects(const SkRect &r) const
bool contains(SkScalar x, SkScalar y) const
void join(const SkRect &r)
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)