15 #include "include/private/base/SkSafe32.h"
16 #include "include/private/base/SkTFitsIn.h"
55 static constexpr
SkIRect SK_WARN_UNUSED_RESULT
MakeWH(int32_t w, int32_t h) {
91 int32_t r, int32_t b) {
105 int32_t w, int32_t h) {
106 return { x, y, Sk32_sat_add(x, w), Sk32_sat_add(y, h) };
114 constexpr int32_t
left()
const {
return fLeft; }
121 constexpr int32_t
top()
const {
return fTop; }
128 constexpr int32_t
right()
const {
return fRight; }
135 constexpr int32_t
bottom()
const {
return fBottom; }
142 constexpr int32_t
x()
const {
return fLeft; }
149 constexpr int32_t
y()
const {
return fTop; }
159 constexpr int32_t
width()
const {
return Sk32_can_overflow_sub(fRight, fLeft); }
166 constexpr int32_t
height()
const {
return Sk32_can_overflow_sub(fBottom, fTop); }
181 constexpr int64_t
width64()
const {
return (int64_t)fRight - (int64_t)fLeft; }
189 constexpr int64_t
height64()
const {
return (int64_t)fBottom - (int64_t)fTop; }
197 bool isEmpty64()
const {
return fRight <= fLeft || fBottom <= fTop; }
204 int64_t w = this->width64();
205 int64_t h = this->height64();
206 if (w <= 0 || h <= 0) {
210 return !SkTFitsIn<int32_t>(w | h);
243 void setEmpty() { memset(
this, 0,
sizeof(*
this)); }
254 void setLTRB(int32_t left, int32_t top, int32_t right, int32_t bottom) {
269 void setXYWH(int32_t x, int32_t y, int32_t width, int32_t height) {
272 fRight = Sk32_sat_add(x, width);
273 fBottom = Sk32_sat_add(y, height);
276 void setWH(int32_t width, int32_t height) {
286 fRight = size.
width();
303 Sk32_sat_add(fLeft, dx), Sk32_sat_add(fTop, dy),
304 Sk32_sat_add(fRight, dx), Sk32_sat_add(fBottom, dy),
319 return this->makeOffset(offset.
x(), offset.
y());
335 Sk32_sat_add(fLeft, dx), Sk32_sat_add(fTop, dy),
336 Sk32_sat_sub(fRight, dx), Sk32_sat_sub(fBottom, dy),
353 Sk32_sat_sub(fLeft, dx), Sk32_sat_sub(fTop, dy),
354 Sk32_sat_add(fRight, dx), Sk32_sat_add(fBottom, dy),
369 fLeft = Sk32_sat_add(fLeft, dx);
370 fTop = Sk32_sat_add(fTop, dy);
371 fRight = Sk32_sat_add(fRight, dx);
372 fBottom = Sk32_sat_add(fBottom, dy);
386 this->offset(delta.
fX, delta.
fY);
396 fRight = Sk64_pin_to_s32((int64_t)fRight + newX - fLeft);
397 fBottom = Sk64_pin_to_s32((int64_t)fBottom + newY - fTop);
412 void inset(int32_t dx, int32_t dy) {
413 fLeft = Sk32_sat_add(fLeft, dx);
414 fTop = Sk32_sat_add(fTop, dy);
415 fRight = Sk32_sat_sub(fRight, dx);
416 fBottom = Sk32_sat_sub(fBottom, dy);
429 void outset(int32_t dx, int32_t dy) { this->inset(-dx, -dy); }
447 void adjust(int32_t dL, int32_t dT, int32_t dR, int32_t dB) {
448 fLeft = Sk32_sat_add(fLeft, dL);
449 fTop = Sk32_sat_add(fTop, dT);
450 fRight = Sk32_sat_add(fRight, dR);
451 fBottom = Sk32_sat_add(fBottom, dB);
465 return x >= fLeft && x < fRight && y >= fTop && y < fBottom;
477 return !r.
isEmpty() && !this->isEmpty() &&
490 inline bool contains(
const SkRect& r)
const;
501 SkASSERT(fLeft < fRight && fTop < fBottom);
515 return this->intersect(*
this, r);
556 if (fLeft > fRight) {
559 if (fTop > fBottom) {
571 return MakeLTRB(std::min(fLeft, fRight), std::min(fTop, fBottom),
572 std::max(fLeft, fRight), std::max(fTop, fBottom));
597 return SkRect{0, 0, 0, 0};
611 return SkRect{0, 0, w, h};
649 return SkRect {l, t, r, b};
663 return SkRect {x, y, x + w, y + h};
699 return !(fLeft < fRight && fTop < fBottom);
708 bool isSorted()
const {
return fLeft <= fRight && fTop <= fBottom; }
809 constexpr
SkPoint center()
const {
return {this->centerX(), this->centerY()}; }
896 (void)this->setBoundsCheck(pts, count);
931 fLeft = std::min(p0.
fX, p1.
fX);
932 fRight = std::max(p0.
fX, p1.
fX);
933 fTop = std::min(p0.
fY, p1.
fY);
934 fBottom = std::max(p0.
fY, p1.
fY);
949 fBottom = y + height;
964 void setIWH(int32_t width, int32_t height) {
980 return MakeLTRB(fLeft + dx, fTop + dy, fRight + dx, fBottom + dy);
1002 return MakeLTRB(fLeft + dx, fTop + dy, fRight - dx, fBottom - dy);
1017 return MakeLTRB(fLeft - dx, fTop - dy, fRight + dx, fBottom + dy);
1048 this->offset(delta.
fX, delta.
fY);
1058 fRight += newX - fLeft;
1059 fBottom += newY - fTop;
1124 return L < R && T < B;
1136 return Intersects(fLeft, fTop, fRight, fBottom,
1175 if (fLeft >= fRight || fTop >= fBottom) {
1178 this->joinPossiblyEmptyRect(r);
1189 fLeft = std::min(fLeft, r.
left());
1190 fTop = std::min(fTop, r.
top());
1191 fRight = std::max(fRight, r.
right());
1192 fBottom = std::max(fBottom, r.
bottom());
1203 return x >= fLeft && x < fRight && y >= fTop && y < fBottom;
1216 return !r.
isEmpty() && !this->isEmpty() &&
1231 return !r.
isEmpty() && !this->isEmpty() &&
1307 this->roundOut(&ir);
1329 if (fLeft > fRight) {
1330 swap(fLeft, fRight);
1333 if (fTop > fBottom) {
1334 swap(fTop, fBottom);
1345 return MakeLTRB(std::min(fLeft, fRight), std::min(fTop, fBottom),
1346 std::max(fLeft, fRight), std::max(fTop, fBottom));
void swap(sk_sp< T > &a, sk_sp< T > &b)
Definition: SkRefCnt.h:340
#define SkScalarFloorToScalar(x)
Definition: SkScalar.h:31
#define SkScalarHalf(a)
Definition: SkScalar.h:90
#define SkScalarRoundToInt(x)
Definition: SkScalar.h:38
#define SkScalarCeilToInt(x)
Definition: SkScalar.h:37
#define SkIntToScalar(x)
Definition: SkScalar.h:58
static bool SkScalarIsNaN(SkScalar x)
Definition: SkScalar.h:67
#define SkScalarFloorToInt(x)
Definition: SkScalar.h:36
float SkScalar
Definition: SkScalar.h:17
#define SkScalarCeilToScalar(x)
Definition: SkScalar.h:32
static bool SkScalarsEqual(const SkScalar a[], const SkScalar b[], int n)
Definition: SkScalar.h:166
SkIPoint holds two 32-bit integer coordinates.
Definition: SkPoint.h:27
constexpr int32_t y() const
Returns y-axis value of SkIPoint.
Definition: SkPoint.h:51
int32_t fX
x-axis value
Definition: SkPoint.h:28
int32_t fY
y-axis value
Definition: SkPoint.h:29
constexpr int32_t x() const
Returns x-axis value of SkIPoint.
Definition: SkPoint.h:45
SkIRect holds four 32-bit integer coordinates describing the upper and lower bounds of a rectangle.
Definition: SkRect.h:31
constexpr int64_t height64() const
Returns span on the y-axis.
Definition: SkRect.h:189
void sort()
Swaps fLeft and fRight if fLeft is greater than fRight; and swaps fTop and fBottom if fTop is greater...
Definition: SkRect.h:554
constexpr int32_t x() const
Returns left edge of SkIRect, if sorted.
Definition: SkRect.h:142
friend bool operator!=(const SkIRect &a, const SkIRect &b)
Returns true if any member in a: fLeft, fTop, fRight, and fBottom; is not identical to the correspond...
Definition: SkRect.h:232
void adjust(int32_t dL, int32_t dT, int32_t dR, int32_t dB)
Adjusts SkIRect by adding dL to fLeft, dT to fTop, dR to fRight, and dB to fBottom.
Definition: SkRect.h:447
SkIRect makeOutset(int32_t dx, int32_t dy) const
Returns SkIRect, outset by (dx, dy).
Definition: SkRect.h:351
void inset(int32_t dx, int32_t dy)
Insets SkIRect by (dx,dy).
Definition: SkRect.h:412
bool isEmpty64() const
Returns true if fLeft is equal to or greater than fRight, or if fTop is equal to or greater than fBot...
Definition: SkRect.h:197
bool contains(const SkIRect &r) const
Returns true if SkIRect contains r.
Definition: SkRect.h:476
constexpr int32_t y() const
Returns top edge of SkIRect, if sorted.
Definition: SkRect.h:149
static constexpr SkIRect SK_WARN_UNUSED_RESULT MakeLTRB(int32_t l, int32_t t, int32_t r, int32_t b)
Returns constructed SkIRect set to (l, t, r, b).
Definition: SkRect.h:90
static constexpr SkIRect SK_WARN_UNUSED_RESULT MakePtSize(SkIPoint pt, SkISize size)
Returns constructed SkIRect set to (pt.x(), pt.y(), pt.x() + size.width(), pt.y() + size....
Definition: SkRect.h:77
void offset(const SkIPoint &delta)
Offsets SkIRect by adding delta.fX to fLeft, fRight; and by adding delta.fY to fTop,...
Definition: SkRect.h:385
bool intersect(const SkIRect &r)
Returns true if SkIRect intersects r, and sets SkIRect to intersection.
Definition: SkRect.h:514
static bool Intersects(const SkIRect &a, const SkIRect &b)
Returns true if a intersects b.
Definition: SkRect.h:536
int32_t fBottom
larger y-axis bounds
Definition: SkRect.h:35
constexpr int32_t top() const
Returns top edge of SkIRect, if sorted.
Definition: SkRect.h:121
void offsetTo(int32_t newX, int32_t newY)
Offsets SkIRect so that fLeft equals newX, and fTop equals newY.
Definition: SkRect.h:395
bool containsNoEmptyCheck(const SkIRect &r) const
Returns true if SkIRect contains construction.
Definition: SkRect.h:500
constexpr SkISize size() const
Returns spans on the x-axis and y-axis.
Definition: SkRect.h:173
static constexpr SkIRect SK_WARN_UNUSED_RESULT MakeXYWH(int32_t x, int32_t y, int32_t w, int32_t h)
Returns constructed SkIRect set to: (x, y, x + w, y + h).
Definition: SkRect.h:104
constexpr int32_t bottom() const
Returns bottom edge of SkIRect, if sorted.
Definition: SkRect.h:135
constexpr int32_t height() const
Returns span on the y-axis.
Definition: SkRect.h:166
constexpr int32_t right() const
Returns right edge of SkIRect, if sorted.
Definition: SkRect.h:128
int32_t fTop
smaller y-axis bounds
Definition: SkRect.h:33
void join(const SkIRect &r)
Sets SkIRect to the union of itself and r.
constexpr SkIRect makeOffset(SkIVector offset) const
Returns SkIRect offset by (offset.x(), offset.y()).
Definition: SkRect.h:318
constexpr int32_t width() const
Returns span on the x-axis.
Definition: SkRect.h:159
friend bool operator==(const SkIRect &a, const SkIRect &b)
Returns true if all members in a: fLeft, fTop, fRight, and fBottom; are identical to corresponding me...
Definition: SkRect.h:220
constexpr int64_t width64() const
Returns span on the x-axis.
Definition: SkRect.h:181
void offset(int32_t dx, int32_t dy)
Offsets SkIRect by adding dx to fLeft, fRight; and by adding dy to fTop, fBottom.
Definition: SkRect.h:368
static constexpr SkIRect SK_WARN_UNUSED_RESULT MakeSize(const SkISize &size)
Returns constructed SkIRect set to (0, 0, size.width(), size.height()).
Definition: SkRect.h:65
void setEmpty()
Sets SkIRect to (0, 0, 0, 0).
Definition: SkRect.h:243
constexpr SkIRect makeOffset(int32_t dx, int32_t dy) const
Returns SkIRect offset by (dx, dy).
Definition: SkRect.h:301
bool isEmpty() const
Returns true if width() or height() are zero or negative.
Definition: SkRect.h:203
void setXYWH(int32_t x, int32_t y, int32_t width, int32_t height)
Sets SkIRect to: (x, y, x + width, y + height).
Definition: SkRect.h:269
constexpr SkIPoint topLeft() const
Definition: SkRect.h:152
static constexpr SkIRect SK_WARN_UNUSED_RESULT MakeWH(int32_t w, int32_t h)
Returns constructed SkIRect set to (0, 0, w, h).
Definition: SkRect.h:55
void setWH(int32_t width, int32_t height)
Definition: SkRect.h:276
SkIRect makeInset(int32_t dx, int32_t dy) const
Returns SkIRect, inset by (dx, dy).
Definition: SkRect.h:333
static constexpr SkIRect SK_WARN_UNUSED_RESULT MakeEmpty()
Returns constructed SkIRect set to (0, 0, 0, 0).
Definition: SkRect.h:44
int32_t fLeft
smaller x-axis bounds
Definition: SkRect.h:32
SkIRect makeSorted() const
Returns SkIRect with fLeft and fRight swapped if fLeft is greater than fRight; and with fTop and fBot...
Definition: SkRect.h:570
void outset(int32_t dx, int32_t dy)
Outsets SkIRect by (dx, dy).
Definition: SkRect.h:429
bool SK_WARN_UNUSED_RESULT intersect(const SkIRect &a, const SkIRect &b)
Returns true if a intersects b, and sets SkIRect to intersection.
constexpr int32_t left() const
Returns left edge of SkIRect, if sorted.
Definition: SkRect.h:114
void setLTRB(int32_t left, int32_t top, int32_t right, int32_t bottom)
Sets SkIRect to (left, top, right, bottom).
Definition: SkRect.h:254
bool contains(int32_t x, int32_t y) const
Returns true if: fLeft <= x < fRight && fTop <= y < fBottom.
Definition: SkRect.h:464
int32_t fRight
larger x-axis bounds
Definition: SkRect.h:34
void setSize(SkISize size)
Definition: SkRect.h:283
static constexpr SkISize Make(int32_t w, int32_t h)
Definition: SkSize.h:19
int32_t fHeight
Definition: SkSize.h:17
int32_t fWidth
Definition: SkSize.h:16
constexpr int32_t width() const
Definition: SkSize.h:35
constexpr int32_t height() const
Definition: SkSize.h:36
SkPoint holds two 32-bit floating point coordinates.
Definition: SkPoint.h:162
SkScalar fX
x-axis value
Definition: SkPoint.h:163
constexpr SkScalar y() const
Returns y-axis value of SkPoint or vector.
Definition: SkPoint.h:186
SkScalar fY
y-axis value
Definition: SkPoint.h:164
constexpr SkScalar x() const
Returns x-axis value of SkPoint or vector.
Definition: SkPoint.h:180
SkRect holds four SkScalar coordinates describing the upper and lower bounds of a rectangle.
Definition: SkRect.h:583
constexpr SkRect makeOffset(SkVector v) const
Returns SkRect offset by v.
Definition: SkRect.h:988
static constexpr SkRect SK_WARN_UNUSED_RESULT MakeEmpty()
Returns constructed SkRect set to (0, 0, 0, 0).
Definition: SkRect.h:596
SkRect makeSorted() const
Returns SkRect with fLeft and fRight swapped if fLeft is greater than fRight; and with fTop and fBott...
Definition: SkRect.h:1344
constexpr SkScalar centerY() const
Returns average of top edge and bottom edge.
Definition: SkRect.h:801
static SkRect Make(const SkISize &size)
Returns constructed SkIRect set to (0, 0, size.width(), size.height()).
Definition: SkRect.h:672
bool SK_WARN_UNUSED_RESULT intersect(const SkRect &a, const SkRect &b)
Returns true if a intersects b, and sets SkRect to intersection.
void setLTRB(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom)
Sets SkRect to (left, top, right, bottom).
Definition: SkRect.h:879
static bool Intersects(const SkRect &a, const SkRect &b)
Returns true if a intersects b.
Definition: SkRect.h:1147
SkScalar fBottom
larger y-axis bounds
Definition: SkRect.h:587
static constexpr SkRect SK_WARN_UNUSED_RESULT MakeSize(const SkSize &size)
Returns constructed SkRect set to (0, 0, size.width(), size.height()).
Definition: SkRect.h:634
void toQuad(SkPoint quad[4]) const
Returns four points in quad that enclose SkRect ordered as: top-left, top-right, bottom-right,...
static constexpr SkRect SK_WARN_UNUSED_RESULT MakeWH(SkScalar w, SkScalar h)
Returns constructed SkRect set to SkScalar values (0, 0, w, h).
Definition: SkRect.h:610
void joinNonEmptyArg(const SkRect &r)
Sets SkRect to the union of itself and r.
Definition: SkRect.h:1172
void outset(SkScalar dx, SkScalar dy)
Outsets SkRect by (dx, dy).
Definition: SkRect.h:1091
void offset(const SkPoint &delta)
Offsets SkRect by adding delta.fX to fLeft, fRight; and by adding delta.fY to fTop,...
Definition: SkRect.h:1047
static SkRect SK_WARN_UNUSED_RESULT MakeIWH(int w, int h)
Returns constructed SkRect set to integer values (0, 0, w, h).
Definition: SkRect.h:624
void setWH(SkScalar width, SkScalar height)
Sets SkRect to (0, 0, width, height).
Definition: SkRect.h:958
constexpr SkScalar x() const
Returns left edge of SkRect, if sorted.
Definition: SkRect.h:735
friend bool operator==(const SkRect &a, const SkRect &b)
Returns true if all members in a: fLeft, fTop, fRight, and fBottom; are equal to the corresponding me...
Definition: SkRect.h:821
bool isFinite() const
Returns true if all values in the rectangle are finite: SK_ScalarMin or larger, and SK_ScalarMax or s...
Definition: SkRect.h:715
void joinPossiblyEmptyRect(const SkRect &r)
Sets SkRect to the union of itself and the construction.
Definition: SkRect.h:1188
void roundIn(SkIRect *dst) const
Sets SkRect by rounding up fLeft and fTop; and discarding the fractional portion of fRight and fBotto...
Definition: SkRect.h:1280
constexpr SkScalar bottom() const
Returns bottom edge of SkRect, if sorted.
Definition: SkRect.h:770
bool intersect(const SkRect &r)
Returns true if SkRect intersects r, and sets SkRect to intersection.
SkScalar fLeft
smaller x-axis bounds
Definition: SkRect.h:584
constexpr SkScalar centerX() const
Returns average of left edge and right edge.
Definition: SkRect.h:791
void roundOut(SkRect *dst) const
Sets SkRect by discarding the fractional portion of fLeft and fTop; and rounding up fRight and fBotto...
Definition: SkRect.h:1268
void offset(SkScalar dx, SkScalar dy)
Offsets SkRect by adding dx to fLeft, fRight; and by adding dy to fTop, fBottom.
Definition: SkRect.h:1030
bool contains(const SkRect &r) const
Returns true if SkRect contains r.
Definition: SkRect.h:1214
bool intersects(const SkRect &r) const
Returns true if SkRect intersects r.
Definition: SkRect.h:1135
void set(const SkPoint &p0, const SkPoint &p1)
Sets bounds to the smallest SkRect enclosing SkPoint p0 and p1.
Definition: SkRect.h:930
bool contains(const SkIRect &r) const
Returns true if SkRect contains r.
Definition: SkRect.h:1229
SkScalar fRight
larger x-axis bounds
Definition: SkRect.h:586
constexpr SkRect makeOffset(SkScalar dx, SkScalar dy) const
Returns SkRect offset by (dx, dy).
Definition: SkRect.h:979
SkIRect roundOut() const
Sets SkIRect by discarding the fractional portion of fLeft and fTop; and rounding up fRight and fBott...
Definition: SkRect.h:1305
bool contains(SkScalar x, SkScalar y) const
Returns true if: fLeft <= x < fRight && fTop <= y < fBottom.
Definition: SkRect.h:1202
void roundOut(SkIRect *dst) const
Sets SkIRect by discarding the fractional portion of fLeft and fTop; and rounding up fRight and fBott...
Definition: SkRect.h:1255
void setXYWH(SkScalar x, SkScalar y, SkScalar width, SkScalar height)
Sets SkRect to (x, y, x + width, y + height).
Definition: SkRect.h:945
SkIRect roundIn() const
Sets SkIRect by rounding up fLeft and fTop; and discarding the fractional portion of fRight and fBott...
Definition: SkRect.h:1317
void round(SkIRect *dst) const
Sets SkIRect by adding 0.5 and discarding the fractional portion of SkRect members,...
Definition: SkRect.h:1242
const SkScalar * asScalars() const
Returns pointer to first scalar in SkRect, to treat it as an array with four entries.
Definition: SkRect.h:1354
constexpr SkScalar top() const
Returns top edge of SkRect, if sorted.
Definition: SkRect.h:756
constexpr SkScalar right() const
Returns right edge of SkRect, if sorted.
Definition: SkRect.h:763
SkRect makeOutset(SkScalar dx, SkScalar dy) const
Returns SkRect, outset by (dx, dy).
Definition: SkRect.h:1016
constexpr SkScalar left() const
Returns left edge of SkRect, if sorted.
Definition: SkRect.h:749
bool setBoundsCheck(const SkPoint pts[], int count)
Sets to bounds of SkPoint array with count entries.
SkIRect round() const
Returns SkIRect by adding 0.5 and discarding the fractional portion of SkRect members,...
Definition: SkRect.h:1292
void setIWH(int32_t width, int32_t height)
Definition: SkRect.h:964
constexpr SkScalar width() const
Returns span on the x-axis.
Definition: SkRect.h:777
void setBounds(const SkPoint pts[], int count)
Sets to bounds of SkPoint array with count entries.
Definition: SkRect.h:895
SkRect makeInset(SkScalar dx, SkScalar dy) const
Returns SkRect, inset by (dx, dy).
Definition: SkRect.h:1001
static constexpr SkRect SK_WARN_UNUSED_RESULT MakeLTRB(SkScalar l, SkScalar t, SkScalar r, SkScalar b)
Returns constructed SkRect set to (l, t, r, b).
Definition: SkRect.h:647
bool isEmpty() const
Returns true if fLeft is equal to or greater than fRight, or if fTop is equal to or greater than fBot...
Definition: SkRect.h:696
void join(const SkRect &r)
Sets SkRect to the union of itself and r.
constexpr SkScalar height() const
Returns span on the y-axis.
Definition: SkRect.h:784
void sort()
Swaps fLeft and fRight if fLeft is greater than fRight; and swaps fTop and fBottom if fTop is greater...
Definition: SkRect.h:1327
constexpr SkPoint center() const
Returns the point this->centerX(), this->centerY().
Definition: SkRect.h:809
void dump() const
Writes text representation of SkRect to standard output.
Definition: SkRect.h:1370
void dumpHex() const
Writes text representation of SkRect to standard output.
Definition: SkRect.h:1379
void setBoundsNoCheck(const SkPoint pts[], int count)
Sets to bounds of SkPoint pts array with count entries.
constexpr SkScalar y() const
Returns top edge of SkRect, if sorted.
Definition: SkRect.h:742
void inset(SkScalar dx, SkScalar dy)
Insets SkRect by (dx, dy).
Definition: SkRect.h:1074
friend bool operator!=(const SkRect &a, const SkRect &b)
Returns true if any in a: fLeft, fTop, fRight, and fBottom; does not equal the corresponding members ...
Definition: SkRect.h:835
static SkRect SK_WARN_UNUSED_RESULT Make(const SkIRect &irect)
Returns constructed SkIRect set to irect, promoting integers to scalar.
Definition: SkRect.h:683
void offsetTo(SkScalar newX, SkScalar newY)
Offsets SkRect so that fLeft equals newX, and fTop equals newY.
Definition: SkRect.h:1057
bool isSorted() const
Returns true if fLeft is equal to or less than fRight, or if fTop is equal to or less than fBottom.
Definition: SkRect.h:708
static constexpr SkRect SK_WARN_UNUSED_RESULT MakeXYWH(SkScalar x, SkScalar y, SkScalar w, SkScalar h)
Returns constructed SkRect set to (x, y, x + w, y + h).
Definition: SkRect.h:661
void set(const SkIRect &src)
Sets SkRect to src, promoting src members from integer to scalar.
Definition: SkRect.h:863
void dump(bool asHex) const
Writes text representation of SkRect to standard output.
SkScalar fTop
smaller y-axis bounds
Definition: SkRect.h:585
void setEmpty()
Sets SkRect to (0, 0, 0, 0).
Definition: SkRect.h:856
SkScalar fHeight
Definition: SkSize.h:53
SkScalar fWidth
Definition: SkSize.h:52