Go to the source code of this file.
◆ GrClipSrcRectAndDstPoint()
Clips the srcRect and the dstPoint to the bounds of the srcSize and dstSize respectively. Returns true if the srcRect and dstRect intersect the srcRect and dst rect (dstPoint with srcRect width/height). Returns false otherwise. The clipped values are stored back into 'dstPoint' and 'srcRect'
Definition at line 48 of file GrRect.h.
51 {
52
53 if (srcRect->
fLeft < 0) {
56 }
57 if (dstPoint->
fX < 0) {
60 }
61
62
63 if (srcRect->
fTop < 0) {
64 dstPoint->
fY -= srcRect->
fTop;
66 }
67 if (dstPoint->
fY < 0) {
68 srcRect->
fTop -= dstPoint->
fY;
70 }
71
72
75 }
78 }
79
80
83 }
86 }
87
88
89
91}
int32_t fBottom
larger y-axis bounds
constexpr int32_t height() const
int32_t fTop
smaller y-axis bounds
constexpr int32_t width() const
int32_t fLeft
smaller x-axis bounds
int32_t fRight
larger x-axis bounds
constexpr int32_t width() const
constexpr int32_t height() const
◆ GrMapRectPoints()
Apply the transform from 'inRect' to 'outRect' to each point in 'inPts', storing the mapped point into the parallel index of 'outPts'.
Definition at line 37 of file GrRect.h.
38 {
40}
static SkMatrix RectToRect(const SkRect &src, const SkRect &dst, ScaleToFit mode=kFill_ScaleToFit)
void mapPoints(SkPoint dst[], const SkPoint src[], int count) const
◆ GrRectsOverlap()
static bool GrRectsOverlap |
( |
const SkRect & |
a, |
|
|
const SkRect & |
b |
|
) |
| |
|
inlinestatic |
Returns true if the rectangles have a nonzero area of overlap. It assumed that rects can be infinitely small but not "inverted".
Definition at line 17 of file GrRect.h.
17 {
18
19 SkASSERT(!
a.isFinite() || (
a.fLeft <=
a.fRight &&
a.fTop <=
a.fBottom));
20 SkASSERT(!
b.isFinite() || (
b.fLeft <=
b.fRight &&
b.fTop <=
b.fBottom));
21 return a.fRight >
b.fLeft &&
a.fBottom >
b.fTop &&
b.fRight >
a.fLeft &&
b.fBottom >
a.fTop;
22}
◆ GrRectsTouchOrOverlap()
static bool GrRectsTouchOrOverlap |
( |
const SkRect & |
a, |
|
|
const SkRect & |
b |
|
) |
| |
|
inlinestatic |
Returns true if the rectangles overlap or share an edge or corner. It assumed that rects can be infinitely small but not "inverted".
Definition at line 26 of file GrRect.h.
26 {
27
28 SkASSERT(!
a.isFinite() || (
a.fLeft <=
a.fRight &&
a.fTop <=
a.fBottom));
29 SkASSERT(!
b.isFinite() || (
b.fLeft <=
b.fRight &&
b.fTop <=
b.fBottom));
30 return a.fRight >=
b.fLeft &&
a.fBottom >=
b.fTop &&
b.fRight >=
a.fLeft &&
b.fBottom >=
a.fTop;
31}