blob: 578949a3b189e16b7d7eaa9b0573035cfc5646fe [file] [log] [blame]
Cary Clark0c5f5462017-12-15 11:21:51 -05001#Topic IRect
Cary Clark2dc84ad2018-01-26 12:56:22 -05002#Alias IRects
Cary Clark0c5f5462017-12-15 11:21:51 -05003#Alias IRect_Reference
4
Cary Clark08895c42018-02-01 09:37:32 -05005#Subtopic Overview
Cary Clark4855f782018-02-06 09:41:53 -05006 #Subtopic Subtopic
Cary Clark08895c42018-02-01 09:37:32 -05007 #Populate
8 ##
Cary Clark2dc84ad2018-01-26 12:56:22 -05009##
10
Cary Clark0c5f5462017-12-15 11:21:51 -050011#Struct SkIRect
12
13SkIRect holds four 32 bit integer coordinates describing the upper and
14lower bounds of a rectangle. SkIRect may be created from outer bounds or
15from position, width, and height. SkIRect describes an area; if its right
16is less than or equal to its left, or if its bottom is less than or equal to
17its top, it is considered empty.
18
Cary Clark4855f782018-02-06 09:41:53 -050019#Subtopic Related_Function
Cary Clark08895c42018-02-01 09:37:32 -050020#Populate
Cary Clark0c5f5462017-12-15 11:21:51 -050021#Subtopic ##
22
Cary Clark4855f782018-02-06 09:41:53 -050023#Subtopic Member_Function
24#Populate
25#Subtopic ##
26
27#Subtopic Member
Cary Clark08895c42018-02-01 09:37:32 -050028#Populate
Cary Clark0c5f5462017-12-15 11:21:51 -050029
30#Member int32_t fLeft
Cary Clark08895c42018-02-01 09:37:32 -050031#Line # smaller x-axis bounds ##
Cary Clark0c5f5462017-12-15 11:21:51 -050032May contain any value. The smaller of the horizontal values when sorted.
33When equal to or greater than fRight, IRect is empty.
34##
35
36#Member int32_t fTop
Cary Clark08895c42018-02-01 09:37:32 -050037#Line # smaller y-axis bounds ##
Cary Clark0c5f5462017-12-15 11:21:51 -050038May contain any value. The smaller of the horizontal values when sorted.
39When equal to or greater than fBottom, IRect is empty.
40##
41
42#Member int32_t fRight
Cary Clark08895c42018-02-01 09:37:32 -050043#Line # larger x-axis bounds ##
Cary Clark0c5f5462017-12-15 11:21:51 -050044May contain any value. The larger of the vertical values when sorted.
45When equal to or less than fLeft, IRect is empty.
46##
47
48#Member int32_t fBottom
Cary Clark08895c42018-02-01 09:37:32 -050049#Line # larger y-axis bounds ##
Cary Clark0c5f5462017-12-15 11:21:51 -050050May contain any value. The larger of the vertical values when sorted.
51When equal to or less than fTop, IRect is empty.
52##
53
Cary Clark4855f782018-02-06 09:41:53 -050054#Subtopic Member ##
Cary Clark2dc84ad2018-01-26 12:56:22 -050055
Cary Clark4855f782018-02-06 09:41:53 -050056#Subtopic Constructor
Cary Clark08895c42018-02-01 09:37:32 -050057#Populate
Cary Clark2dc84ad2018-01-26 12:56:22 -050058
Cary Clark0c5f5462017-12-15 11:21:51 -050059# ------------------------------------------------------------------------------
60
61#Method static constexpr SkIRect SK_WARN_UNUSED_RESULT MakeEmpty()
62
Cary Clark4855f782018-02-06 09:41:53 -050063#In Constructor
Cary Clarkab2621d2018-01-30 10:08:57 -050064#Line # returns bounds of (0, 0, 0, 0) ##
Cary Clark0c5f5462017-12-15 11:21:51 -050065Returns constructed IRect set to (0, 0, 0, 0).
66Many other rectangles are empty; if left is equal to or greater than right,
67or if top is equal to or greater than bottom. Setting all members to zero
68is a convenience, but does not designate a special empty rectangle.
69
70#Return bounds (0, 0, 0, 0) ##
71
72#Example
73 SkIRect rect = SkIRect::MakeEmpty();
74 SkDebugf("MakeEmpty isEmpty: %s\n", rect.isEmpty() ? "true" : "false");
75 rect.offset(10, 10);
76 SkDebugf("offset rect isEmpty: %s\n", rect.isEmpty() ? "true" : "false");
77 rect.inset(10, 10);
78 SkDebugf("inset rect isEmpty: %s\n", rect.isEmpty() ? "true" : "false");
79 rect.outset(20, 20);
80 SkDebugf("outset rect isEmpty: %s\n", rect.isEmpty() ? "true" : "false");
81#StdOut
82MakeEmpty isEmpty: true
83offset rect isEmpty: true
84inset rect isEmpty: true
85outset rect isEmpty: false
86##
87##
88
Mike Reed274218e2018-01-08 15:05:02 -050089#SeeAlso EmptyIRect isEmpty setEmpty SkRect::MakeEmpty
Cary Clark0c5f5462017-12-15 11:21:51 -050090
91##
92
93# ------------------------------------------------------------------------------
94
95#Method static constexpr SkIRect SK_WARN_UNUSED_RESULT MakeWH(int32_t w, int32_t h)
96
Cary Clark4855f782018-02-06 09:41:53 -050097#In Constructor
Cary Clarkab2621d2018-01-30 10:08:57 -050098#Line # constructs from int input returning (0, 0, width, height) ##
Cary Clark0c5f5462017-12-15 11:21:51 -050099Returns constructed IRect set to (0, 0, w, h). Does not validate input; w or h
100may be negative.
101
Cary Clark2dc84ad2018-01-26 12:56:22 -0500102#Param w width of constructed IRect ##
103#Param h height of constructed IRect ##
Cary Clark0c5f5462017-12-15 11:21:51 -0500104
105#Return bounds (0, 0, w, h) ##
106
107#Example
108 SkIRect rect1 = SkIRect::MakeWH(25, 35);
109 SkIRect rect2 = SkIRect::MakeSize({25, 35});
110 SkIRect rect3 = SkIRect::MakeXYWH(0, 0, 25, 35);
111 SkIRect rect4 = SkIRect::MakeLTRB(0, 0, 25, 35);
112 SkDebugf("all %s" "equal\n", rect1 == rect2 && rect2 == rect3 && rect3 == rect4 ?
113 "" : "not ");
114#StdOut
115all equal
116##
117##
118
119#SeeAlso MakeSize MakeXYWH SkRect::MakeWH SkRect::MakeIWH
120
121##
122
123# ------------------------------------------------------------------------------
124
125#Method static constexpr SkIRect SK_WARN_UNUSED_RESULT MakeSize(const SkISize& size)
126
Cary Clark4855f782018-02-06 09:41:53 -0500127#In Constructor
Cary Clarkab2621d2018-01-30 10:08:57 -0500128#Line # constructs from ISize returning (0, 0, width, height) ##
Cary Clark0c5f5462017-12-15 11:21:51 -0500129Returns constructed IRect set to (0, 0, size.width(), size.height()).
130Does not validate input; size.width() or size.height() may be negative.
131
Cary Clark2dc84ad2018-01-26 12:56:22 -0500132#Param size values for IRect width and height ##
Cary Clark0c5f5462017-12-15 11:21:51 -0500133
134#Return bounds (0, 0, size.width(), size.height()) ##
135
136#Example
137 SkSize size = {25.5f, 35.5f};
138 SkIRect rect = SkIRect::MakeSize(size.toRound());
139 SkDebugf("round width: %d height: %d\n", rect.width(), rect.height());
140 rect = SkIRect::MakeSize(size.toFloor());
141 SkDebugf("floor width: %d height: %d\n", rect.width(), rect.height());
142#StdOut
143round width: 26 height: 36
144floor width: 25 height: 35
145##
146##
147
148#SeeAlso MakeWH MakeXYWH SkRect::Make SkRect::MakeIWH
149
150##
151
152# ------------------------------------------------------------------------------
153
154#Method static constexpr SkIRect SK_WARN_UNUSED_RESULT MakeLTRB(int32_t l, int32_t t, int32_t r, int32_t b)
155
Cary Clark4855f782018-02-06 09:41:53 -0500156#In Constructor
Cary Clarkab2621d2018-01-30 10:08:57 -0500157#Line # constructs from int left, top, right, bottom ##
Cary Clark2dc84ad2018-01-26 12:56:22 -0500158Returns constructed IRect set to (l, t, r, b). Does not sort input; IRect may
Cary Clark0c5f5462017-12-15 11:21:51 -0500159result in fLeft greater than fRight, or fTop greater than fBottom.
160
161#Param l integer stored in fLeft ##
162#Param t integer stored in fTop ##
163#Param r integer stored in fRight ##
164#Param b integer stored in fBottom ##
165
166#Return bounds (l, t, r, b) ##
167
168#Example
169 SkIRect rect = SkIRect::MakeLTRB(5, 35, 15, 25);
170 SkDebugf("rect: %d, %d, %d, %d isEmpty: %s\n", rect.left(), rect.top(), rect.right(),
171 rect.bottom(), rect.isEmpty() ? "true" : "false");
172 rect.sort();
173 SkDebugf("rect: %d, %d, %d, %d isEmpty: %s\n", rect.left(), rect.top(), rect.right(),
174 rect.bottom(), rect.isEmpty() ? "true" : "false");
175#StdOut
176rect: 5, 35, 15, 25 isEmpty: true
177rect: 5, 25, 15, 35 isEmpty: false
178##
179##
180
181#SeeAlso MakeXYWH SkRect::MakeLTRB
182
183##
184
185# ------------------------------------------------------------------------------
186
187#Method static constexpr SkIRect SK_WARN_UNUSED_RESULT MakeXYWH(int32_t x, int32_t y, int32_t w, int32_t h)
188
Cary Clark4855f782018-02-06 09:41:53 -0500189#In Constructor
Cary Clarkab2621d2018-01-30 10:08:57 -0500190#Line # constructs from int input returning (x, y, width, height) ##
Cary Clark0c5f5462017-12-15 11:21:51 -0500191Returns constructed IRect set to:
192#Formula
193(x, y, x + w, y + h)
194##
195. Does not validate input;
196w or h may be negative.
197
198#Param x stored in fLeft ##
199#Param y stored in fTop ##
200#Param w added to x and stored in fRight ##
201#Param h added to y and stored in fBottom ##
202
203#Return bounds at (x, y) with width w and height h ##
204
205#Example
206 SkIRect rect = SkIRect::MakeXYWH(5, 35, -15, 25);
207 SkDebugf("rect: %d, %d, %d, %d isEmpty: %s\n", rect.left(), rect.top(), rect.right(),
208 rect.bottom(), rect.isEmpty() ? "true" : "false");
209 rect.sort();
210 SkDebugf("rect: %d, %d, %d, %d isEmpty: %s\n", rect.left(), rect.top(), rect.right(),
211 rect.bottom(), rect.isEmpty() ? "true" : "false");
212#StdOut
213rect: 5, 35, -10, 60 isEmpty: true
214rect: -10, 35, 5, 60 isEmpty: false
215##
216##
217
218#SeeAlso MakeLTRB SkRect::MakeXYWH
219
220##
221
Cary Clark4855f782018-02-06 09:41:53 -0500222#Subtopic Constructor ##
Cary Clark2dc84ad2018-01-26 12:56:22 -0500223
Cary Clark4855f782018-02-06 09:41:53 -0500224#Subtopic Property
225#Line # member values, center, validity ##
226#Populate
227##
Cary Clark2dc84ad2018-01-26 12:56:22 -0500228
Cary Clark0c5f5462017-12-15 11:21:51 -0500229# ------------------------------------------------------------------------------
230
Cary Clark6def7202018-01-04 08:13:35 -0500231#Method int32_t left() const
Cary Clark0c5f5462017-12-15 11:21:51 -0500232
Cary Clark4855f782018-02-06 09:41:53 -0500233#In Property
Cary Clarkab2621d2018-01-30 10:08:57 -0500234#Line # returns smaller bounds in x, if sorted ##
Cary Clark0c5f5462017-12-15 11:21:51 -0500235Returns left edge of IRect, if sorted.
236Call sort() to reverse fLeft and fRight if needed.
237
238#Return fLeft ##
239
240#Example
241 SkIRect unsorted = { 15, 5, 10, 25 };
242 SkDebugf("unsorted.fLeft: %d unsorted.left(): %d\n", unsorted.fLeft, unsorted.left());
243 SkIRect sorted = unsorted.makeSorted();
244 SkDebugf("sorted.fLeft: %d sorted.left(): %d\n", sorted.fLeft, sorted.left());
245#StdOut
246unsorted.fLeft: 15 unsorted.left(): 15
247sorted.fLeft: 10 sorted.left(): 10
248##
249##
250
251#SeeAlso fLeft x() SkRect::left()
252
253##
254
255# ------------------------------------------------------------------------------
256
Cary Clark6def7202018-01-04 08:13:35 -0500257#Method int32_t top() const
Cary Clark0c5f5462017-12-15 11:21:51 -0500258
Cary Clark4855f782018-02-06 09:41:53 -0500259#In Property
Cary Clarkab2621d2018-01-30 10:08:57 -0500260#Line # returns smaller bounds in y, if sorted ##
Cary Clark0c5f5462017-12-15 11:21:51 -0500261Returns top edge of IRect, if sorted. Call isEmpty to see if IRect may be invalid,
262and sort() to reverse fTop and fBottom if needed.
263
264#Return fTop ##
265
266#Example
267 SkIRect unsorted = { 15, 25, 10, 5 };
268 SkDebugf("unsorted.fTop: %d unsorted.top(): %d\n", unsorted.fTop, unsorted.top());
269 SkIRect sorted = unsorted.makeSorted();
270 SkDebugf("sorted.fTop: %d sorted.top(): %d\n", sorted.fTop, sorted.top());
271#StdOut
272unsorted.fTop: 25 unsorted.top(): 25
273sorted.fTop: 5 sorted.top(): 5
274##
275##
276
277#SeeAlso fTop y() SkRect::top()
278
279##
280
281# ------------------------------------------------------------------------------
282
Cary Clark6def7202018-01-04 08:13:35 -0500283#Method int32_t right() const
Cary Clark0c5f5462017-12-15 11:21:51 -0500284
Cary Clark4855f782018-02-06 09:41:53 -0500285#In Property
Cary Clarkab2621d2018-01-30 10:08:57 -0500286#Line # returns larger bounds in x, if sorted ##
Cary Clark0c5f5462017-12-15 11:21:51 -0500287Returns right edge of IRect, if sorted.
288Call sort() to reverse fLeft and fRight if needed.
289
290#Return fRight ##
291
292#Example
293 SkIRect unsorted = { 15, 25, 10, 5 };
294 SkDebugf("unsorted.fRight: %d unsorted.right(): %d\n", unsorted.fRight, unsorted.right());
295 SkIRect sorted = unsorted.makeSorted();
296 SkDebugf("sorted.fRight: %d sorted.right(): %d\n", sorted.fRight, sorted.right());
297#StdOut
298unsorted.fRight: 10 unsorted.right(): 10
299sorted.fRight: 15 sorted.right(): 15
300##
301##
302
303#SeeAlso fRight SkRect::right()
304
305##
306
307# ------------------------------------------------------------------------------
308
Cary Clark6def7202018-01-04 08:13:35 -0500309#Method int32_t bottom() const
Cary Clark0c5f5462017-12-15 11:21:51 -0500310
Cary Clark4855f782018-02-06 09:41:53 -0500311#In Property
Cary Clarkab2621d2018-01-30 10:08:57 -0500312#Line # returns larger bounds in y, if sorted ##
Cary Clark0c5f5462017-12-15 11:21:51 -0500313Returns bottom edge of IRect, if sorted. Call isEmpty to see if IRect may be invalid,
314and sort() to reverse fTop and fBottom if needed.
315
316#Return fBottom ##
317
318#Example
319 SkIRect unsorted = { 15, 25, 10, 5 };
320 SkDebugf("unsorted.fBottom: %d unsorted.bottom(): %d\n", unsorted.fBottom, unsorted.bottom());
321 SkIRect sorted = unsorted.makeSorted();
322 SkDebugf("sorted.fBottom: %d sorted.bottom(): %d\n", sorted.fBottom, sorted.bottom());
323#StdOut
324unsorted.fBottom: 5 unsorted.bottom(): 5
325sorted.fBottom: 25 sorted.bottom(): 25
326##
327##
328
329#SeeAlso fBottom SkRect::bottom()
330
331##
332
333# ------------------------------------------------------------------------------
334
Cary Clark6def7202018-01-04 08:13:35 -0500335#Method int32_t x() const
Cary Clark0c5f5462017-12-15 11:21:51 -0500336
Cary Clark4855f782018-02-06 09:41:53 -0500337#In Property
Cary Clarkab2621d2018-01-30 10:08:57 -0500338#Line # returns bounds left ##
Cary Clark0c5f5462017-12-15 11:21:51 -0500339Returns left edge of IRect, if sorted. Call isEmpty to see if IRect may be invalid,
340and sort() to reverse fLeft and fRight if needed.
341
342#Return fLeft ##
343
344#Example
345 SkIRect unsorted = { 15, 5, 10, 25 };
346 SkDebugf("unsorted.fLeft: %d unsorted.x(): %d\n", unsorted.fLeft, unsorted.x());
347 SkIRect sorted = unsorted.makeSorted();
348 SkDebugf("sorted.fLeft: %d sorted.x(): %d\n", sorted.fLeft, sorted.x());
349#StdOut
350unsorted.fLeft: 15 unsorted.x(): 15
351sorted.fLeft: 10 sorted.x(): 10
352##
353##
354
355#SeeAlso fLeft left() y() SkRect::x()
356
357##
358
359# ------------------------------------------------------------------------------
360
Cary Clark6def7202018-01-04 08:13:35 -0500361#Method int32_t y() const
Cary Clark0c5f5462017-12-15 11:21:51 -0500362
Cary Clark4855f782018-02-06 09:41:53 -0500363#In Property
Cary Clarkab2621d2018-01-30 10:08:57 -0500364#Line # returns bounds top ##
Cary Clark0c5f5462017-12-15 11:21:51 -0500365Returns top edge of IRect, if sorted. Call isEmpty to see if IRect may be invalid,
366and sort() to reverse fTop and fBottom if needed.
367
368#Return fTop ##
369
370#Example
371 SkIRect unsorted = { 15, 25, 10, 5 };
372 SkDebugf("unsorted.fTop: %d unsorted.y(): %d\n", unsorted.fTop, unsorted.y());
373 SkIRect sorted = unsorted.makeSorted();
374 SkDebugf("sorted.fTop: %d sorted.y(): %d\n", sorted.fTop, sorted.y());
375#StdOut
376unsorted.fTop: 25 unsorted.y(): 25
377sorted.fTop: 5 sorted.y(): 5
378##
379##
380
381#SeeAlso fTop top() x() SkRect::y()
382
383##
384
385# ------------------------------------------------------------------------------
386
Cary Clark6def7202018-01-04 08:13:35 -0500387#Method int32_t width() const
Cary Clark0c5f5462017-12-15 11:21:51 -0500388
Cary Clark4855f782018-02-06 09:41:53 -0500389#In Property
Cary Clarkab2621d2018-01-30 10:08:57 -0500390#Line # returns span in x ##
Cary Clark0c5f5462017-12-15 11:21:51 -0500391Returns span on the x-axis. This does not check if IRect is sorted, or if
392result fits in 32-bit signed integer; result may be negative.
393
394#Return fRight minus fLeft ##
395
396#Example
397 SkIRect unsorted = { 15, 25, 10, 5 };
398 SkDebugf("unsorted width: %d\n", unsorted.width());
399 SkIRect large = { -2147483647, 1, 2147483644, 2 };
400 SkDebugf("large width: %d\n", large.width());
401#StdOut
402unsorted width: -5
403large width: -5
404##
405##
406
Mike Reeda766ca92018-01-09 11:31:53 -0500407#SeeAlso height() width64() height64() SkRect::width()
408
409##
410
411# ------------------------------------------------------------------------------
412
413#Method int64_t width64() const
414
Cary Clark4855f782018-02-06 09:41:53 -0500415#In Property
Cary Clarkab2621d2018-01-30 10:08:57 -0500416#Line # returns span in y as int64_t ##
Mike Reeda766ca92018-01-09 11:31:53 -0500417Returns span on the x-axis. This does not check if IRect is sorted, so the
418result may be negative. This is safer than calling width() since width() might
419overflow in its calculation.
420
421#Return fRight minus fLeft cast to int64_t ##
422
Cary Clark186d08f2018-04-03 08:43:27 -0400423#Example
Mike Reeda766ca92018-01-09 11:31:53 -0500424SkIRect large = { -2147483647, 1, 2147483644, 2 };
Cary Clark186d08f2018-04-03 08:43:27 -0400425SkDebugf("width: %d width64: %lld\n", large.width(), large.width64());
Mike Reeda766ca92018-01-09 11:31:53 -0500426#StdOut
427width: -5 width64: 4294967291
428##
429##
430
431#SeeAlso width() height() height64() SkRect::width()
Cary Clark0c5f5462017-12-15 11:21:51 -0500432
433##
434
435# ------------------------------------------------------------------------------
436
Cary Clark6def7202018-01-04 08:13:35 -0500437#Method int32_t height() const
Cary Clark0c5f5462017-12-15 11:21:51 -0500438
Cary Clark4855f782018-02-06 09:41:53 -0500439#In Property
Cary Clarkab2621d2018-01-30 10:08:57 -0500440#Line # returns span in y ##
Cary Clark0c5f5462017-12-15 11:21:51 -0500441Returns span on the y-axis. This does not check if IRect is sorted, or if
442result fits in 32-bit signed integer; result may be negative.
443
444#Return fBottom minus fTop ##
445
446#Example
447 SkIRect unsorted = { 15, 25, 10, 20 };
448 SkDebugf("unsorted height: %d\n", unsorted.height());
449 SkIRect large = { 1, -2147483647, 2, 2147483644 };
450 SkDebugf("large height: %d\n", large.height());
451#StdOut
452unsorted height: -5
453large height: -5
454##
455##
456
457#SeeAlso width() SkRect::height()
458
459##
460
461# ------------------------------------------------------------------------------
462
Mike Reeda766ca92018-01-09 11:31:53 -0500463#Method int64_t height64() const
464
Cary Clark4855f782018-02-06 09:41:53 -0500465#In Property
Cary Clarkab2621d2018-01-30 10:08:57 -0500466#Line # returns span in y as int64_t ##
Mike Reeda766ca92018-01-09 11:31:53 -0500467Returns span on the y-axis. This does not check if IRect is sorted, so the
468result may be negative. This is safer than calling height() since height() might
469overflow in its calculation.
470
471#Return fBottom minus fTop cast to int64_t ##
472
Cary Clark186d08f2018-04-03 08:43:27 -0400473#Example
Mike Reeda766ca92018-01-09 11:31:53 -0500474SkIRect large = { 1, -2147483647, 2, 2147483644 };
475SkDebugf("height: %d height64: %lld\n", large.height(), large.height64());
476#StdOut
477height: -5 height64: 4294967291
478##
479##
480
481#SeeAlso width() height() width64() SkRect::height()
482
483##
484
485# ------------------------------------------------------------------------------
486
Cary Clark0c5f5462017-12-15 11:21:51 -0500487#Method SkISize size() const
488
Cary Clark4855f782018-02-06 09:41:53 -0500489#In Property
Cary Clarkab2621d2018-01-30 10:08:57 -0500490#Line # returns ISize (width, height) ##
Cary Clark0c5f5462017-12-15 11:21:51 -0500491Returns spans on the x-axis and y-axis. This does not check if IRect is sorted,
492or if result fits in 32-bit signed integer; result may be negative.
493
494#Return ISize (width, height) ##
495
496#Example
497 auto debugster = [](const char* prefix, const SkIRect& rect) -> void {
498 SkISize size = rect.size();
499 SkDebugf("%s ", prefix);
500 SkDebugf("rect: %d, %d, %d, %d ", rect.left(), rect.top(), rect.right(), rect.bottom());
501 SkDebugf("size: %d, %d\n", size.width(), size.height());
502 };
503 SkIRect rect = {20, 30, 40, 50};
504 debugster("original", rect);
505 rect.offset(20, 20);
506 debugster(" offset", rect);
507 rect.outset(20, 20);
508 debugster(" outset", rect);
509#StdOut
510original rect: 20, 30, 40, 50 size: 20, 20
511 offset rect: 40, 50, 60, 70 size: 20, 20
512 outset rect: 20, 30, 80, 90 size: 60, 60
513##
514##
515
516#SeeAlso height() width() MakeSize
517
518##
519
520# ------------------------------------------------------------------------------
521
Cary Clark0c5f5462017-12-15 11:21:51 -0500522#Method bool isEmpty() const
523
Cary Clark4855f782018-02-06 09:41:53 -0500524#In Property
Cary Clarkab2621d2018-01-30 10:08:57 -0500525#Line # returns true if width or height are zero or negative or they exceed int32_t ##
Mike Reedd2849492018-01-10 14:31:18 -0500526Returns true if width() or height() .
Cary Clark0c5f5462017-12-15 11:21:51 -0500527
528#Return true if width() or height() are zero or negative ##
529
530#Example
531 SkIRect tests[] = {{20, 40, 10, 50}, {20, 40, 20, 50}};
532 for (auto rect : tests) {
533 SkDebugf("rect: {%d, %d, %d, %d} is" "%s empty\n", rect.left(), rect.top(), rect.right(),
534 rect.bottom(), rect.isEmpty() ? "" : " not");
535 rect.sort();
536 SkDebugf("sorted: {%d, %d, %d, %d} is" "%s empty\n", rect.left(), rect.top(), rect.right(),
537 rect.bottom(), rect.isEmpty() ? "" : " not");
538 }
539#StdOut
540rect: {20, 40, 10, 50} is empty
541sorted: {10, 40, 20, 50} is not empty
542rect: {20, 40, 20, 50} is empty
543sorted: {20, 40, 20, 50} is empty
544##
545##
546
547#SeeAlso EmptyIRect MakeEmpty sort SkRect::isEmpty
548
549##
550
551# ------------------------------------------------------------------------------
552
Mike Reedd2849492018-01-10 14:31:18 -0500553#Method bool isEmpty64() const
554
Cary Clark4855f782018-02-06 09:41:53 -0500555#In Property
Cary Clarkab2621d2018-01-30 10:08:57 -0500556#Line # returns true if width or height are zero or negative ##
Mike Reedd2849492018-01-10 14:31:18 -0500557Returns true if fLeft is equal to or greater than fRight, or if fTop is equal
558to or greater than fBottom. Call sort() to reverse rectangles with negative
559width64() or height64().
560
561#Return true if width64() or height64() are zero or negative ##
562
Cary Clark186d08f2018-04-03 08:43:27 -0400563#Example
Mike Reedd2849492018-01-10 14:31:18 -0500564SkIRect tests[] = {{20, 40, 10, 50}, {20, 40, 20, 50}};
565for (auto rect : tests) {
Cary Clark186d08f2018-04-03 08:43:27 -0400566 SkDebugf("rect: {%d, %d, %d, %d} is" "%s empty\n", rect.left(), rect.top(), rect.right(),
567 rect.bottom(), rect.isEmpty64() ? "" : " not");
568 rect.sort();
569 SkDebugf("sorted: {%d, %d, %d, %d} is" "%s empty\n", rect.left(), rect.top(), rect.right(),
570 rect.bottom(), rect.isEmpty64() ? "" : " not");
Mike Reedd2849492018-01-10 14:31:18 -0500571}
572#StdOut
573rect: {20, 40, 10, 50} is empty
574sorted: {10, 40, 20, 50} is not empty
575rect: {20, 40, 20, 50} is empty
576sorted: {20, 40, 20, 50} is empty
577##
578##
579
580#SeeAlso EmptyIRect MakeEmpty sort SkRect::isEmpty
581
582##
583
Cary Clark4855f782018-02-06 09:41:53 -0500584#Subtopic Operator
Cary Clark08895c42018-02-01 09:37:32 -0500585#Populate
Cary Clark2dc84ad2018-01-26 12:56:22 -0500586
Mike Reedd2849492018-01-10 14:31:18 -0500587# ------------------------------------------------------------------------------
588
Cary Clark0c5f5462017-12-15 11:21:51 -0500589#Method bool operator==(const SkIRect& a, const SkIRect& b)
590
Cary Clark4855f782018-02-06 09:41:53 -0500591#In Operator
Cary Clarkab2621d2018-01-30 10:08:57 -0500592#Line # returns true if members are equal ##
Cary Clark0c5f5462017-12-15 11:21:51 -0500593Returns true if all members in a: fLeft, fTop, fRight, and fBottom; are
594identical to corresponding members in b.
595
596#Param a IRect to compare ##
597#Param b IRect to compare ##
598
599#Return true if members are equal ##
600
601#Example
602 SkIRect test = {0, 0, 2, 2};
603 SkIRect sorted = test.makeSorted();
604 SkDebugf("test %c= sorted\n", test == sorted ? '=' : '!');
605#StdOut
606test == sorted
607##
608##
609
610#SeeAlso operator!=(const SkIRect& a, const SkIRect& b)
611
612##
613
614# ------------------------------------------------------------------------------
615
616#Method bool operator!=(const SkIRect& a, const SkIRect& b)
617
Cary Clark4855f782018-02-06 09:41:53 -0500618#In Operator
Cary Clarkab2621d2018-01-30 10:08:57 -0500619#Line # returns true if members are unequal ##
Cary Clark0c5f5462017-12-15 11:21:51 -0500620Returns true if any member in a: fLeft, fTop, fRight, and fBottom; is not
621identical to the corresponding member in b.
622
623#Param a IRect to compare ##
624#Param b IRect to compare ##
625
626#Return true if members are not equal ##
627
628#Example
629 SkIRect test = {2, 2, 0, 0};
630 SkIRect sorted = test.makeSorted();
631 SkDebugf("test %c= sorted\n", test != sorted ? '!' : '=');
632#StdOut
633test != sorted
634##
635##
636
637#SeeAlso operator==(const SkIRect& a, const SkIRect& b)
638
639##
640
Cary Clark4855f782018-02-06 09:41:53 -0500641#Subtopic Operator ##
Cary Clark2dc84ad2018-01-26 12:56:22 -0500642
Cary Clark0c5f5462017-12-15 11:21:51 -0500643# ------------------------------------------------------------------------------
644
Cary Clark78de7512018-02-07 07:27:09 -0500645#Subtopic Set
646#Line # replaces all values ##
647#Populate
648##
Cary Clark0c5f5462017-12-15 11:21:51 -0500649
650#Method void setEmpty()
651
Cary Clark4855f782018-02-06 09:41:53 -0500652#In Set
Cary Clarkab2621d2018-01-30 10:08:57 -0500653#Line # sets to (0, 0, 0, 0) ##
Cary Clark0c5f5462017-12-15 11:21:51 -0500654Sets IRect to (0, 0, 0, 0).
655
656Many other rectangles are empty; if left is equal to or greater than right,
657or if top is equal to or greater than bottom. Setting all members to zero
658is a convenience, but does not designate a special empty rectangle.
659
660#Example
661 SkIRect rect = {3, 4, 1, 2};
662 for (int i = 0; i < 2; ++i) {
663 SkDebugf("rect: {%d, %d, %d, %d} is %s" "empty\n", rect.fLeft, rect.fTop,
664 rect.fRight, rect.fBottom, rect.isEmpty() ? "" : "not ");
665 rect.setEmpty();
666 }
667#StdOut
668rect: {3, 4, 1, 2} is empty
669rect: {0, 0, 0, 0} is empty
670##
671##
672
673#SeeAlso MakeEmpty SkRect::setEmpty
674
675##
676
677# ------------------------------------------------------------------------------
678
679#Method void set(int32_t left, int32_t top, int32_t right, int32_t bottom)
680
Cary Clark4855f782018-02-06 09:41:53 -0500681#In Set
Cary Clarkab2621d2018-01-30 10:08:57 -0500682#Line # sets to (left, top, right, bottom) ##
Cary Clark0c5f5462017-12-15 11:21:51 -0500683Sets IRect to (left, top, right, bottom).
684left and right are not sorted; left is not necessarily less than right.
685top and bottom are not sorted; top is not necessarily less than bottom.
686
687#Param left assigned to fLeft ##
688#Param top assigned to fTop ##
689#Param right assigned to fRight ##
690#Param bottom assigned to fBottom ##
691
692#Example
693 SkIRect rect1 = {3, 4, 1, 2};
694 SkDebugf("rect1: {%d, %d, %d, %d}\n", rect1.fLeft, rect1.fTop, rect1.fRight, rect1.fBottom);
695 SkIRect rect2;
696 rect2.set(3, 4, 1, 2);
697 SkDebugf("rect2: {%d, %d, %d, %d}\n", rect2.fLeft, rect2.fTop, rect2.fRight, rect2.fBottom);
698#StdOut
699rect1: {3, 4, 1, 2}
700rect2: {3, 4, 1, 2}
701##
702##
703
704#SeeAlso setLTRB setXYWH SkRect::set
705
706##
707
708# ------------------------------------------------------------------------------
709
710#Method void setLTRB(int32_t left, int32_t top, int32_t right, int32_t bottom)
711
Cary Clark4855f782018-02-06 09:41:53 -0500712#In Set
Cary Clarkab2621d2018-01-30 10:08:57 -0500713#Line # sets to SkScalar input (left, top, right, bottom) ##
Cary Clark0c5f5462017-12-15 11:21:51 -0500714Sets IRect to (left, top, right, bottom).
715left and right are not sorted; left is not necessarily less than right.
716top and bottom are not sorted; top is not necessarily less than bottom.
717
718#Param left stored in fLeft ##
719#Param top stored in fTop ##
720#Param right stored in fRight ##
721#Param bottom stored in fBottom ##
722
723#Example
724 SkIRect rect1 = {3, 4, 1, 2};
725 SkDebugf("rect1: {%d, %d, %d, %d}\n", rect1.fLeft, rect1.fTop, rect1.fRight, rect1.fBottom);
726 SkIRect rect2;
727 rect2.setLTRB(3, 4, 1, 2);
728 SkDebugf("rect2: {%d, %d, %d, %d}\n", rect2.fLeft, rect2.fTop, rect2.fRight, rect2.fBottom);
729#StdOut
730rect1: {3, 4, 1, 2}
731rect2: {3, 4, 1, 2}
732##
733##
734
735#SeeAlso set setXYWH SkRect::setLTRB
736
737##
738
739# ------------------------------------------------------------------------------
740
741#Method void setXYWH(int32_t x, int32_t y, int32_t width, int32_t height)
742
Cary Clark4855f782018-02-06 09:41:53 -0500743#In Set
Cary Clarkab2621d2018-01-30 10:08:57 -0500744#Line # sets to (x, y, width, height) ##
Cary Clark0c5f5462017-12-15 11:21:51 -0500745Sets IRect to:
746#Formula
747(x, y, x + width, y + height)
748##
749. Does not validate input;
750width or height may be negative.
751
752#Param x stored in fLeft ##
753#Param y stored in fTop ##
754#Param width added to x and stored in fRight ##
755#Param height added to y and stored in fBottom ##
756
757#Example
758 SkIRect rect;
759 rect.setXYWH(5, 35, -15, 25);
760 SkDebugf("rect: %d, %d, %d, %d isEmpty: %s\n", rect.left(), rect.top(), rect.right(),
761 rect.bottom(), rect.isEmpty() ? "true" : "false");
762 rect.sort();
763 SkDebugf("rect: %d, %d, %d, %d isEmpty: %s\n", rect.left(), rect.top(), rect.right(),
764 rect.bottom(), rect.isEmpty() ? "true" : "false");
765#StdOut
766rect: 5, 35, -10, 60 isEmpty: true
767rect: -10, 35, 5, 60 isEmpty: false
768##
769##
770
771#SeeAlso MakeXYWH setLTRB set SkRect::setXYWH
772
773##
774
Cary Clark2dc84ad2018-01-26 12:56:22 -0500775#Subtopic Inset_Outset_Offset
Cary Clark08895c42018-02-01 09:37:32 -0500776#Line # moves sides ##
Cary Clark4855f782018-02-06 09:41:53 -0500777#Populate
Cary Clark2dc84ad2018-01-26 12:56:22 -0500778
Cary Clark0c5f5462017-12-15 11:21:51 -0500779# ------------------------------------------------------------------------------
780
Cary Clark0c5f5462017-12-15 11:21:51 -0500781#Method SkIRect makeOffset(int32_t dx, int32_t dy) const
782
Cary Clarkab2621d2018-01-30 10:08:57 -0500783#In Inset_Outset_Offset
784#Line # constructs from translated sides ##
Cary Clark0c5f5462017-12-15 11:21:51 -0500785Returns IRect offset by (dx, dy).
786
787If dx is negative, IRect returned is moved to the left.
788If dx is positive, IRect returned is moved to the right.
789If dy is negative, IRect returned is moved upward.
790If dy is positive, IRect returned is moved downward.
791
792#Param dx offset added to fLeft and fRight ##
793#Param dy offset added to fTop and fBottom ##
794
Cary Clark2dc84ad2018-01-26 12:56:22 -0500795#Return IRect offset in x or y, with original width and height ##
Cary Clark0c5f5462017-12-15 11:21:51 -0500796
797#Example
798 SkIRect rect = { 10, 50, 20, 60 };
799 SkDebugf("rect: %d, %d, %d, %d isEmpty: %s\n", rect.left(), rect.top(), rect.right(),
800 rect.bottom(), rect.isEmpty() ? "true" : "false");
801 rect = rect.makeOffset(15, 32);
802 SkDebugf("rect: %d, %d, %d, %d isEmpty: %s\n", rect.left(), rect.top(), rect.right(),
803 rect.bottom(), rect.isEmpty() ? "true" : "false");
804#StdOut
805rect: 10, 50, 20, 60 isEmpty: false
806rect: 25, 82, 35, 92 isEmpty: false
807##
808##
809
810#SeeAlso offset() makeInset makeOutset SkRect::makeOffset
811
812##
813
814# ------------------------------------------------------------------------------
815
816#Method SkIRect makeInset(int32_t dx, int32_t dy) const
817
Cary Clarkab2621d2018-01-30 10:08:57 -0500818#In Inset_Outset_Offset
819#Line # constructs from sides moved symmetrically about the center ##
Cary Clark0c5f5462017-12-15 11:21:51 -0500820Returns IRect, inset by (dx, dy).
821
822If dx is negative, IRect returned is wider.
823If dx is positive, IRect returned is narrower.
824If dy is negative, IRect returned is taller.
825If dy is positive, IRect returned is shorter.
826
827#Param dx offset added to fLeft and subtracted from fRight ##
828#Param dy offset added to fTop and subtracted from fBottom ##
829
Cary Clark2dc84ad2018-01-26 12:56:22 -0500830#Return IRect inset symmetrically left and right, top and bottom ##
Cary Clark0c5f5462017-12-15 11:21:51 -0500831
832#Example
833 SkIRect rect = { 10, 50, 20, 60 };
834 SkDebugf("rect: %d, %d, %d, %d isEmpty: %s\n", rect.left(), rect.top(), rect.right(),
835 rect.bottom(), rect.isEmpty() ? "true" : "false");
836 rect = rect.makeInset(15, 32);
837 SkDebugf("rect: %d, %d, %d, %d isEmpty: %s\n", rect.left(), rect.top(), rect.right(),
838 rect.bottom(), rect.isEmpty() ? "true" : "false");
839#StdOut
840rect: 10, 50, 20, 60 isEmpty: false
841rect: 25, 82, 5, 28 isEmpty: true
842##
843##
844
845#SeeAlso inset() makeOffset makeOutset SkRect::makeInset
846
847##
848
849# ------------------------------------------------------------------------------
850
851#Method SkIRect makeOutset(int32_t dx, int32_t dy) const
852
Cary Clarkab2621d2018-01-30 10:08:57 -0500853#In Inset_Outset_Offset
854#Line # constructs from sides moved symmetrically about the center ##
Cary Clark0c5f5462017-12-15 11:21:51 -0500855Returns IRect, outset by (dx, dy).
856
857If dx is negative, IRect returned is narrower.
858If dx is positive, IRect returned is wider.
859If dy is negative, IRect returned is shorter.
860If dy is positive, IRect returned is taller.
861
862#Param dx offset subtracted to fLeft and added from fRight ##
863#Param dy offset subtracted to fTop and added from fBottom ##
864
Cary Clark2dc84ad2018-01-26 12:56:22 -0500865#Return IRect outset symmetrically left and right, top and bottom ##
Cary Clark0c5f5462017-12-15 11:21:51 -0500866
867#Example
868 SkIRect rect = { 10, 50, 20, 60 };
869 SkDebugf("rect: %d, %d, %d, %d isEmpty: %s\n", rect.left(), rect.top(), rect.right(),
870 rect.bottom(), rect.isEmpty() ? "true" : "false");
871 rect = rect.makeOutset(15, 32);
872 SkDebugf("rect: %d, %d, %d, %d isEmpty: %s\n", rect.left(), rect.top(), rect.right(),
873 rect.bottom(), rect.isEmpty() ? "true" : "false");
874#StdOut
875rect: 10, 50, 20, 60 isEmpty: false
876rect: -5, 18, 35, 92 isEmpty: false
877##
878##
879
880#SeeAlso outset() makeOffset makeInset SkRect::makeOutset
881
882##
883
884# ------------------------------------------------------------------------------
885
886#Method void offset(int32_t dx, int32_t dy)
887
Cary Clarkab2621d2018-01-30 10:08:57 -0500888#In Inset_Outset_Offset
889#Line # translates sides without changing width and height ##
Cary Clark0c5f5462017-12-15 11:21:51 -0500890Offsets IRect by adding dx to fLeft, fRight; and by adding dy to fTop, fBottom.
891
892If dx is negative, moves IRect returned to the left.
893If dx is positive, moves IRect returned to the right.
894If dy is negative, moves IRect returned upward.
895If dy is positive, moves IRect returned downward.
896
897#Param dx offset added to fLeft and fRight ##
898#Param dy offset added to fTop and fBottom ##
899
900#Example
901 SkIRect rect = { 10, 14, 50, 73 };
902 rect.offset(5, 13);
903 SkDebugf("rect: %d, %d, %d, %d\n", rect.fLeft, rect.fTop, rect.fRight, rect.fBottom);
904#StdOut
905rect: 15, 27, 55, 86
906##
907##
908
909#SeeAlso offsetTo makeOffset SkRect::offset
910
911##
912
913# ------------------------------------------------------------------------------
914
915#Method void offset(const SkIPoint& delta)
916
Cary Clarkab2621d2018-01-30 10:08:57 -0500917#In Inset_Outset_Offset
Cary Clark0c5f5462017-12-15 11:21:51 -0500918Offsets IRect by adding delta.fX to fLeft, fRight; and by adding delta.fY to
919fTop, fBottom.
920
921If delta.fX is negative, moves IRect returned to the left.
922If delta.fX is positive, moves IRect returned to the right.
923If delta.fY is negative, moves IRect returned upward.
924If delta.fY is positive, moves IRect returned downward.
925
926#Param delta offset added to IRect ##
927
928#Example
929 SkIRect rect = { 10, 14, 50, 73 };
930 rect.offset({5, 13});
931 SkDebugf("rect: %d, %d, %d, %d\n", rect.fLeft, rect.fTop, rect.fRight, rect.fBottom);
932#StdOut
933rect: 15, 27, 55, 86
934##
935##
936
937#SeeAlso offsetTo makeOffset SkRect::offset
938
939##
940
941# ------------------------------------------------------------------------------
942
943#Method void offsetTo(int32_t newX, int32_t newY)
944
Cary Clarkab2621d2018-01-30 10:08:57 -0500945#In Inset_Outset_Offset
946#Line # translates to (x, y) without changing width and height ##
Cary Clark0c5f5462017-12-15 11:21:51 -0500947Offsets IRect so that fLeft equals newX, and fTop equals newY. width and height
948are unchanged.
949
950#Param newX stored in fLeft, preserving width() ##
951#Param newY stored in fTop, preserving height() ##
952
953#Example
954 SkIRect rect = { 10, 14, 50, 73 };
955 rect.offsetTo(15, 27);
956 SkDebugf("rect: %d, %d, %d, %d\n", rect.fLeft, rect.fTop, rect.fRight, rect.fBottom);
957#StdOut
958rect: 15, 27, 55, 86
959##
960##
961
962#SeeAlso offset makeOffset setXYWH SkRect::offsetTo
963
964##
965
966# ------------------------------------------------------------------------------
967
968#Method void inset(int32_t dx, int32_t dy)
969
Cary Clarkab2621d2018-01-30 10:08:57 -0500970#In Inset_Outset_Offset
971#Line # moves the sides symmetrically about the center ##
Cary Clark0c5f5462017-12-15 11:21:51 -0500972Insets IRect by (dx,dy).
973
974If dx is positive, makes IRect narrower.
975If dx is negative, makes IRect wider.
976If dy is positive, makes IRect shorter.
977If dy is negative, makes IRect taller.
978
979#Param dx offset added to fLeft and subtracted from fRight ##
980#Param dy offset added to fTop and subtracted from fBottom ##
981
982#Example
983 SkIRect rect = { 10, 14, 50, 73 };
984 rect.inset(5, 13);
985 SkDebugf("rect: %d, %d, %d, %d\n", rect.fLeft, rect.fTop, rect.fRight, rect.fBottom);
986#StdOut
987rect: 15, 27, 45, 60
988##
989##
990
991#SeeAlso outset makeInset SkRect::inset
992
993##
994
995# ------------------------------------------------------------------------------
996
997#Method void outset(int32_t dx, int32_t dy)
998
Cary Clarkab2621d2018-01-30 10:08:57 -0500999#In Inset_Outset_Offset
1000#Line # moves the sides symmetrically about the center ##
Cary Clark0c5f5462017-12-15 11:21:51 -05001001Outsets IRect by (dx, dy).
1002
Cary Clark2dc84ad2018-01-26 12:56:22 -05001003If dx is positive, makes IRect wider.
1004If dx is negative, makes IRect narrower.
1005If dy is positive, makes IRect taller.
1006If dy is negative, makes IRect shorter.
Cary Clark0c5f5462017-12-15 11:21:51 -05001007
1008#Param dx subtracted to fLeft and added from fRight ##
1009#Param dy subtracted to fTop and added from fBottom ##
1010
1011#Example
1012 SkIRect rect = { 10, 14, 50, 73 };
1013 rect.outset(5, 13);
1014 SkDebugf("rect: %d, %d, %d, %d\n", rect.fLeft, rect.fTop, rect.fRight, rect.fBottom);
1015#StdOut
1016rect: 5, 1, 55, 86
1017##
1018##
1019
1020#SeeAlso inset makeOutset SkRect::outset
1021
1022##
1023
Cary Clark2dc84ad2018-01-26 12:56:22 -05001024#Subtopic Inset_Outset_Offset ##
1025
1026#Subtopic Intersection
Cary Clark08895c42018-02-01 09:37:32 -05001027#Line # set to shared bounds ##
Cary Clark2dc84ad2018-01-26 12:56:22 -05001028
1029IRects intersect when they enclose a common area. To intersect, each of the pair
1030must describe area; fLeft is less than fRight, and fTop is less than fBottom;
1031empty() returns false. The intersection of IRect pair can be described by:
1032
1033#Formula
1034(max(a.fLeft, b.fLeft), max(a.fTop, b.fTop),
1035 min(a.fRight, b.fRight), min(a.fBottom, b.fBottom))
1036##
1037.
1038
1039The intersection is only meaningful if the resulting IRect is not empty and
1040describes an area: fLeft is less than fRight, and fTop is less than fBottom.
1041
Cary Clark4855f782018-02-06 09:41:53 -05001042#Populate
Cary Clark2dc84ad2018-01-26 12:56:22 -05001043
Cary Clark0c5f5462017-12-15 11:21:51 -05001044# ------------------------------------------------------------------------------
1045
Cary Clark0c5f5462017-12-15 11:21:51 -05001046#Method bool contains(int32_t x, int32_t y) const
1047
Cary Clarkab2621d2018-01-30 10:08:57 -05001048#In Intersection
Cary Clark300cc5b2018-02-20 12:50:35 -05001049#Line # returns true if IPoint (x, y) is equal or inside ##
Cary Clark0c5f5462017-12-15 11:21:51 -05001050Returns true if:
1051#Formula
1052fLeft <= x < fRight && fTop <= y < fBottom
1053##
1054.
Cary Clark2dc84ad2018-01-26 12:56:22 -05001055Returns false if IRect is empty.
Cary Clark0c5f5462017-12-15 11:21:51 -05001056
1057Considers input to describe constructed IRect:
1058#Formula
1059(x, y, x + 1, y + 1)
1060##
1061and
1062returns true if constructed area is completely enclosed by IRect area.
1063
Cary Clark300cc5b2018-02-20 12:50:35 -05001064#Param x test IPoint x-coordinate ##
1065#Param y test IPoint y-coordinate ##
Cary Clark0c5f5462017-12-15 11:21:51 -05001066
1067#Return true if (x, y) is inside IRect ##
1068
1069#Example
1070 SkIRect rect = { 30, 50, 40, 60 };
1071 SkIPoint pts[] = { { 30, 50}, { 40, 50}, { 30, 60} };
1072 for (auto pt : pts) {
1073 SkDebugf("rect: (%d, %d, %d, %d) %s (%d, %d)\n",
1074 rect.left(), rect.top(), rect.right(), rect.bottom(),
1075 rect.contains(pt.x(), pt.y()) ? "contains" : "does not contain", pt.x(), pt.y());
1076 }
1077#StdOut
1078rect: (30, 50, 40, 60) contains (30, 50)
1079rect: (30, 50, 40, 60) does not contain (40, 50)
1080rect: (30, 50, 40, 60) does not contain (30, 60)
1081##
1082##
1083
1084#SeeAlso containsNoEmptyCheck SkRect::contains
1085
1086##
1087
1088# ------------------------------------------------------------------------------
1089
1090#Method bool contains(int32_t left, int32_t top, int32_t right, int32_t bottom) const
1091
Cary Clarkab2621d2018-01-30 10:08:57 -05001092#In Intersection
Cary Clark2dc84ad2018-01-26 12:56:22 -05001093Constructs IRect to intersect from (left, top, right, bottom). Does not sort
Cary Clark0c5f5462017-12-15 11:21:51 -05001094construction.
1095
Cary Clark2dc84ad2018-01-26 12:56:22 -05001096Returns true if IRect contains construction.
1097Returns false if IRect is empty or construction is empty.
Cary Clark0c5f5462017-12-15 11:21:51 -05001098
Cary Clark2dc84ad2018-01-26 12:56:22 -05001099#Param left x minimum of constructed IRect ##
1100#Param top y minimum of constructed IRect ##
1101#Param right x maximum of constructed IRect ##
1102#Param bottom y maximum of constructed IRect ##
Cary Clark0c5f5462017-12-15 11:21:51 -05001103
1104#Return true if all sides of IRect are outside construction ##
1105
1106#Example
1107 SkIRect rect = { 30, 50, 40, 60 };
1108 SkIRect tests[] = { { 30, 50, 31, 51}, { 39, 49, 40, 50}, { 29, 59, 30, 60} };
1109 for (auto contained : tests) {
1110 bool success = rect.contains(
1111 contained.left(), contained.top(), contained.right(), contained.bottom());
1112 SkDebugf("rect: (%d, %d, %d, %d) %s (%d, %d, %d, %d)\n",
1113 rect.left(), rect.top(), rect.right(), rect.bottom(),
1114 success ? "contains" : "does not contain",
1115 contained.left(), contained.top(), contained.right(), contained.bottom());
1116 }
1117#StdOut
1118rect: (30, 50, 40, 60) contains (30, 50, 31, 51)
1119rect: (30, 50, 40, 60) does not contain (39, 49, 40, 50)
1120rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60)
1121##
1122##
1123
1124#SeeAlso containsNoEmptyCheck SkRect::contains
1125
1126##
1127
1128# ------------------------------------------------------------------------------
1129
1130#Method bool contains(const SkIRect& r) const
1131
Cary Clarkab2621d2018-01-30 10:08:57 -05001132#In Intersection
Cary Clark2dc84ad2018-01-26 12:56:22 -05001133Returns true if IRect contains r.
1134Returns false if IRect is empty or r is empty.
Cary Clark0c5f5462017-12-15 11:21:51 -05001135
Cary Clark2dc84ad2018-01-26 12:56:22 -05001136IRect contains r when IRect area completely includes r area.
Cary Clark0c5f5462017-12-15 11:21:51 -05001137
1138#Param r IRect contained ##
1139
1140#Return true if all sides of IRect are outside r ##
1141
1142#Example
1143 SkIRect rect = { 30, 50, 40, 60 };
1144 SkIRect tests[] = { { 30, 50, 31, 51}, { 39, 49, 40, 50}, { 29, 59, 30, 60} };
1145 for (auto contained : tests) {
1146 SkDebugf("rect: (%d, %d, %d, %d) %s (%d, %d, %d, %d)\n",
1147 rect.left(), rect.top(), rect.right(), rect.bottom(),
1148 rect.contains(contained) ? "contains" : "does not contain",
1149 contained.left(), contained.top(), contained.right(), contained.bottom());
1150 }
1151#StdOut
1152rect: (30, 50, 40, 60) contains (30, 50, 31, 51)
1153rect: (30, 50, 40, 60) does not contain (39, 49, 40, 50)
1154rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60)
1155##
1156##
1157
1158#SeeAlso containsNoEmptyCheck SkRect::contains
1159
1160##
1161
1162# ------------------------------------------------------------------------------
1163
1164#Method bool contains(const SkRect& r) const
1165
Cary Clarkab2621d2018-01-30 10:08:57 -05001166#In Intersection
Cary Clark2dc84ad2018-01-26 12:56:22 -05001167Returns true if IRect contains r.
1168Returns false if IRect is empty or r is empty.
Cary Clark0c5f5462017-12-15 11:21:51 -05001169
Cary Clark2dc84ad2018-01-26 12:56:22 -05001170IRect contains r when IRect area completely includes r area.
Cary Clark0c5f5462017-12-15 11:21:51 -05001171
1172#Param r Rect contained ##
1173
1174#Return true if all sides of IRect are outside r ##
1175
1176#Example
1177 SkIRect rect = { 30, 50, 40, 60 };
1178 SkRect tests[] = { { 30, 50, 31, 51}, { 39, 49, 40, 50}, { 29, 59, 30, 60} };
1179 for (auto contained : tests) {
1180 SkDebugf("rect: (%d, %d, %d, %d) %s (%g, %g, %g, %g)\n",
1181 rect.left(), rect.top(), rect.right(), rect.bottom(),
1182 rect.contains(contained) ? "contains" : "does not contain",
1183 contained.left(), contained.top(), contained.right(), contained.bottom());
1184 }
1185#StdOut
1186rect: (30, 50, 40, 60) contains (30, 50, 31, 51)
1187rect: (30, 50, 40, 60) does not contain (39, 49, 40, 50)
1188rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60)
1189##
1190##
1191
1192#SeeAlso containsNoEmptyCheck SkRect::contains
1193
1194##
1195
1196# ------------------------------------------------------------------------------
1197
1198#Method bool containsNoEmptyCheck(int32_t left, int32_t top,
1199 int32_t right, int32_t bottom) const
Cary Clarkab2621d2018-01-30 10:08:57 -05001200#In Intersection
Cary Clark300cc5b2018-02-20 12:50:35 -05001201#Line # returns true if contains unsorted IRect ##
Cary Clark0c5f5462017-12-15 11:21:51 -05001202
1203Constructs IRect from (left, top, right, bottom). Does not sort
1204construction.
1205
Cary Clark2dc84ad2018-01-26 12:56:22 -05001206Returns true if IRect contains construction.
Cary Clark0c5f5462017-12-15 11:21:51 -05001207Asserts if IRect is empty or construction is empty, and if SK_DEBUG is defined.
1208
Cary Clark2dc84ad2018-01-26 12:56:22 -05001209Return is undefined if IRect is empty or construction is empty.
Cary Clark0c5f5462017-12-15 11:21:51 -05001210
Cary Clark2dc84ad2018-01-26 12:56:22 -05001211#Param left x minimum of constructed IRect ##
1212#Param top y minimum of constructed IRect ##
1213#Param right x maximum of constructed IRect ##
1214#Param bottom y maximum of constructed IRect ##
Cary Clark0c5f5462017-12-15 11:21:51 -05001215
1216#Return true if all sides of IRect are outside construction ##
1217
1218#Example
1219 SkIRect rect = { 30, 50, 40, 60 };
1220 SkIRect tests[] = { { 30, 50, 31, 51}, { 39, 49, 40, 50}, { 29, 59, 30, 60} };
1221 for (auto contained : tests) {
1222 bool success = rect.containsNoEmptyCheck(
1223 contained.left(), contained.top(), contained.right(), contained.bottom());
1224 SkDebugf("rect: (%d, %d, %d, %d) %s (%d, %d, %d, %d)\n",
1225 rect.left(), rect.top(), rect.right(), rect.bottom(),
1226 success ? "contains" : "does not contain",
1227 contained.left(), contained.top(), contained.right(), contained.bottom());
1228 }
1229#StdOut
1230rect: (30, 50, 40, 60) contains (30, 50, 31, 51)
1231rect: (30, 50, 40, 60) does not contain (39, 49, 40, 50)
1232rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60)
1233##
1234##
1235
1236#SeeAlso contains SkRect::contains
1237
1238##
1239
1240# ------------------------------------------------------------------------------
1241
1242#Method bool containsNoEmptyCheck(const SkIRect& r) const
1243
Cary Clarkab2621d2018-01-30 10:08:57 -05001244#In Intersection
Cary Clark2dc84ad2018-01-26 12:56:22 -05001245Returns true if IRect contains construction.
Cary Clark0c5f5462017-12-15 11:21:51 -05001246Asserts if IRect is empty or construction is empty, and if SK_DEBUG is defined.
1247
Cary Clark2dc84ad2018-01-26 12:56:22 -05001248Return is undefined if IRect is empty or construction is empty.
Cary Clark0c5f5462017-12-15 11:21:51 -05001249
Cary Clark2dc84ad2018-01-26 12:56:22 -05001250#Param r IRect contained ##
Cary Clark0c5f5462017-12-15 11:21:51 -05001251
1252#Return true if all sides of IRect are outside r ##
1253
1254#Example
1255 SkIRect rect = { 30, 50, 40, 60 };
1256 SkIRect tests[] = { { 30, 50, 31, 51}, { 39, 49, 40, 50}, { 29, 59, 30, 60} };
1257 for (auto contained : tests) {
1258 SkDebugf("rect: (%d, %d, %d, %d) %s (%d, %d, %d, %d)\n",
1259 rect.left(), rect.top(), rect.right(), rect.bottom(),
1260 rect.containsNoEmptyCheck(contained) ? "contains" : "does not contain",
1261 contained.left(), contained.top(), contained.right(), contained.bottom());
1262 }
1263#StdOut
1264rect: (30, 50, 40, 60) contains (30, 50, 31, 51)
1265rect: (30, 50, 40, 60) does not contain (39, 49, 40, 50)
1266rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60)
1267##
1268##
1269
1270#SeeAlso contains SkRect::contains
1271
1272##
1273
Cary Clark0c5f5462017-12-15 11:21:51 -05001274# ------------------------------------------------------------------------------
1275
1276#Method bool intersect(const SkIRect& r)
1277
Cary Clarkab2621d2018-01-30 10:08:57 -05001278#In Intersection
1279#Line # sets to shared area; returns true if not empty ##
Cary Clark0c5f5462017-12-15 11:21:51 -05001280Returns true if IRect intersects r, and sets IRect to intersection.
1281Returns false if IRect does not intersect r, and leaves IRect unchanged.
1282
1283Returns false if either r or IRect is empty, leaving IRect unchanged.
1284
1285#Param r limit of result ##
1286
Cary Clark2dc84ad2018-01-26 12:56:22 -05001287#Return true if r and IRect have area in common ##
Cary Clark0c5f5462017-12-15 11:21:51 -05001288
1289#Example
1290#Description
1291Two SkDebugf calls are required. If the calls are combined, their arguments
1292may not be evaluated in left to right order: the printed intersection may
1293be before or after the call to intersect.
1294##
1295 SkIRect leftRect = { 10, 40, 50, 80 };
1296 SkIRect rightRect = { 30, 60, 70, 90 };
1297 SkDebugf("%s intersection: ", leftRect.intersect(rightRect) ? "" : "no ");
1298 SkDebugf("%d, %d, %d, %d\n", leftRect.left(), leftRect.top(),
1299 leftRect.right(), leftRect.bottom());
1300#StdOut
1301 intersection: 30, 60, 50, 80
1302##
1303##
1304
1305#SeeAlso Intersects intersectNoEmptyCheck join SkRect::intersect
1306
1307##
1308
1309# ------------------------------------------------------------------------------
1310
1311#Method bool SK_WARN_UNUSED_RESULT intersect(const SkIRect& a, const SkIRect& b)
1312
Cary Clarkab2621d2018-01-30 10:08:57 -05001313#In Intersection
Cary Clark0c5f5462017-12-15 11:21:51 -05001314Returns true if a intersects b, and sets IRect to intersection.
1315Returns false if a does not intersect b, and leaves IRect unchanged.
1316
1317Returns false if either a or b is empty, leaving IRect unchanged.
1318
1319#Param a IRect to intersect ##
1320#Param b IRect to intersect ##
1321
1322#Return true if a and b have area in common ##
1323
1324#Example
1325 SkIRect result;
1326 bool intersected = result.intersect({ 10, 40, 50, 80 }, { 30, 60, 70, 90 });
1327 SkDebugf("%s intersection: %d, %d, %d, %d\n", intersected ? "" : "no ",
1328 result.left(), result.top(), result.right(), result.bottom());
1329#StdOut
1330 intersection: 30, 60, 50, 80
1331##
1332##
1333
1334#SeeAlso Intersects intersectNoEmptyCheck join SkRect::intersect
1335
1336##
1337
1338# ------------------------------------------------------------------------------
1339
1340#Method bool SK_WARN_UNUSED_RESULT intersectNoEmptyCheck(const SkIRect& a, const SkIRect& b)
1341
Cary Clarkab2621d2018-01-30 10:08:57 -05001342#In Intersection
1343#Line # sets to shared area; returns true if not empty skips empty check ##
Cary Clark0c5f5462017-12-15 11:21:51 -05001344Returns true if a intersects b, and sets IRect to intersection.
1345Returns false if a does not intersect b, and leaves IRect unchanged.
1346
1347Asserts if either a or b is empty, and if SK_DEBUG is defined.
1348
1349#Param a IRect to intersect ##
1350#Param b IRect to intersect ##
1351
1352#Return true if a and b have area in common ##
1353
1354#Example
1355 SkIRect result;
Cary Clark681287e2018-03-16 11:34:15 -04001356 if (result.intersectNoEmptyCheck({ 10, 40, 50, 80 }, { 30, 60, 70, 90 })) {
1357 SkDebugf("intersection: %d, %d, %d, %d\n",
1358 result.left(), result.top(), result.right(), result.bottom());
1359 }
Cary Clark0c5f5462017-12-15 11:21:51 -05001360#StdOut
1361 intersection: 30, 60, 50, 80
1362##
1363##
1364
1365#SeeAlso Intersects intersect join SkRect::intersect
1366
1367##
1368
1369# ------------------------------------------------------------------------------
1370
1371#Method bool intersect(int32_t left, int32_t top, int32_t right, int32_t bottom)
1372
Cary Clarkab2621d2018-01-30 10:08:57 -05001373#In Intersection
Cary Clark0c5f5462017-12-15 11:21:51 -05001374Constructs IRect to intersect from (left, top, right, bottom). Does not sort
1375construction.
1376
1377Returns true if IRect intersects construction, and sets IRect to intersection.
1378Returns false if IRect does not intersect construction, and leaves IRect unchanged.
1379
1380Returns false if either construction or IRect is empty, leaving IRect unchanged.
1381
1382#Param left x minimum of constructed IRect ##
1383#Param top y minimum of constructed IRect ##
1384#Param right x maximum of constructed IRect ##
1385#Param bottom y maximum of constructed IRect ##
1386
1387#Return true if construction and IRect have area in common ##
1388
1389#Example
1390#Description
1391Two SkDebugf calls are required. If the calls are combined, their arguments
1392may not be evaluated in left to right order: the printed intersection may
1393be before or after the call to intersect.
1394##
1395 SkIRect leftRect = { 10, 40, 50, 80 };
1396 SkDebugf("%s intersection: ", leftRect.intersect(30, 60, 70, 90) ? "" : "no ");
1397 SkDebugf("%d, %d, %d, %d\n", leftRect.left(), leftRect.top(),
1398 leftRect.right(), leftRect.bottom());
1399#StdOut
1400 intersection: 30, 60, 50, 80
1401##
1402##
1403
1404#SeeAlso intersectNoEmptyCheck Intersects join SkRect::intersect
1405
1406##
1407
1408# ------------------------------------------------------------------------------
1409
1410#Method static bool Intersects(const SkIRect& a, const SkIRect& b)
1411
Cary Clarkab2621d2018-01-30 10:08:57 -05001412#In Intersection
1413#Line # returns true if areas overlap ##
Cary Clark0c5f5462017-12-15 11:21:51 -05001414Returns true if a intersects b.
1415Returns false if either a or b is empty, or do not intersect.
1416
1417#Param a IRect to intersect ##
1418#Param b IRect to intersect ##
1419
1420#Return true if a and b have area in common ##
1421
1422#Example
1423 SkDebugf("%s intersection", SkIRect::Intersects({10, 40, 50, 80}, {30, 60, 70, 90}) ? "" : "no ");
1424#StdOut
1425 intersection
1426##
1427##
1428
1429#SeeAlso IntersectsNoEmptyCheck intersect SkRect::intersect
1430
1431##
1432
1433# ------------------------------------------------------------------------------
1434
1435#Method static bool IntersectsNoEmptyCheck(const SkIRect& a, const SkIRect& b)
1436
Cary Clarkab2621d2018-01-30 10:08:57 -05001437#In Intersection
1438#Line # returns true if areas overlap skips empty check ##
Cary Clark0c5f5462017-12-15 11:21:51 -05001439Returns true if a intersects b.
1440Asserts if either a or b is empty, and if SK_DEBUG is defined.
1441
1442#Param a IRect to intersect ##
1443#Param b IRect to intersect ##
1444
1445#Return true if a and b have area in common ##
1446
1447#Example
1448 SkDebugf("%s intersection", SkIRect::IntersectsNoEmptyCheck(
1449 {10, 40, 50, 80}, {30, 60, 70, 90}) ? "" : "no ");
1450#StdOut
1451 intersection
1452##
1453##
1454
1455#SeeAlso Intersects intersect SkRect::intersect
1456
1457##
1458
Cary Clark2dc84ad2018-01-26 12:56:22 -05001459#Subtopic Intersection ##
Cary Clark0c5f5462017-12-15 11:21:51 -05001460
1461# ------------------------------------------------------------------------------
1462
Cary Clark4855f782018-02-06 09:41:53 -05001463#Subtopic Join
1464#Line # set to union of bounds ##
1465#Populate
1466##
1467
Cary Clark0c5f5462017-12-15 11:21:51 -05001468#Method void join(int32_t left, int32_t top, int32_t right, int32_t bottom)
1469
Cary Clark4855f782018-02-06 09:41:53 -05001470#In Join
Cary Clarkab2621d2018-01-30 10:08:57 -05001471#Line # sets to union of bounds ##
Cary Clark2dc84ad2018-01-26 12:56:22 -05001472Constructs IRect to intersect from (left, top, right, bottom). Does not sort
Cary Clark0c5f5462017-12-15 11:21:51 -05001473construction.
1474
Cary Clark2dc84ad2018-01-26 12:56:22 -05001475Sets IRect to the union of itself and the construction.
Cary Clark0c5f5462017-12-15 11:21:51 -05001476
Cary Clark2dc84ad2018-01-26 12:56:22 -05001477Has no effect if construction is empty. Otherwise, if IRect is empty, sets
1478IRect to construction.
Cary Clark0c5f5462017-12-15 11:21:51 -05001479
Cary Clark2dc84ad2018-01-26 12:56:22 -05001480#Param left x minimum of constructed IRect ##
1481#Param top y minimum of constructed IRect ##
1482#Param right x maximum of constructed IRect ##
1483#Param bottom y maximum of constructed IRect ##
Cary Clark0c5f5462017-12-15 11:21:51 -05001484
1485#Example
1486 SkIRect rect = { 10, 20, 15, 25};
1487 rect.join(50, 60, 55, 65);
1488 SkDebugf("join: %d, %d, %d, %d\n", rect.fLeft, rect.fTop, rect.fRight, rect.fBottom);
1489#StdOut
1490 join: 10, 20, 55, 65
1491##
1492##
1493
1494#SeeAlso set SkRect::join
1495
1496##
1497
1498# ------------------------------------------------------------------------------
1499
1500#Method void join(const SkIRect& r)
1501
Cary Clark4855f782018-02-06 09:41:53 -05001502#In Join
Cary Clark2dc84ad2018-01-26 12:56:22 -05001503Sets IRect to the union of itself and r.
Cary Clark0c5f5462017-12-15 11:21:51 -05001504
Cary Clark2dc84ad2018-01-26 12:56:22 -05001505Has no effect if r is empty. Otherwise, if IRect is empty, sets IRect to r.
Cary Clark0c5f5462017-12-15 11:21:51 -05001506
Cary Clark2dc84ad2018-01-26 12:56:22 -05001507#Param r expansion IRect ##
Cary Clark0c5f5462017-12-15 11:21:51 -05001508
1509#Example
1510 SkIRect rect = { 10, 20, 15, 25};
1511 rect.join({50, 60, 55, 65});
1512 SkDebugf("join: %d, %d, %d, %d\n", rect.fLeft, rect.fTop, rect.fRight, rect.fBottom);
1513#StdOut
1514 join: 10, 20, 55, 65
1515##
1516##
1517
1518#SeeAlso set SkRect::join
1519
1520##
1521
1522# ------------------------------------------------------------------------------
1523
Cary Clark4855f782018-02-06 09:41:53 -05001524#Subtopic Sorting
1525#Line # orders sides ##
1526#Populate
1527##
1528
Cary Clark0c5f5462017-12-15 11:21:51 -05001529#Method void sort()
1530
Cary Clark4855f782018-02-06 09:41:53 -05001531#In Sorting
Cary Clarkab2621d2018-01-30 10:08:57 -05001532#Line # orders sides from smaller to larger ##
Cary Clark0c5f5462017-12-15 11:21:51 -05001533Swaps fLeft and fRight if fLeft is greater than fRight; and swaps
1534fTop and fBottom if fTop is greater than fBottom. Result may be empty,
1535and width() and height() will be zero or positive.
1536
1537#Example
1538 SkIRect rect = { 30, 50, 20, 10 };
1539 SkDebugf("rect: %d, %d, %d, %d\n", rect.fLeft, rect.fTop, rect.fRight, rect.fBottom);
1540 rect.sort();
1541 SkDebugf("sorted: %d, %d, %d, %d\n", rect.fLeft, rect.fTop, rect.fRight, rect.fBottom);
1542#StdOut
1543rect: 30, 50, 20, 10
1544sorted: 20, 10, 30, 50
1545##
1546##
1547
1548#SeeAlso makeSorted SkRect::sort
1549
1550##
1551
1552# ------------------------------------------------------------------------------
1553
1554#Method SkIRect makeSorted() const
1555
Cary Clark4855f782018-02-06 09:41:53 -05001556#In Sorting
1557#In Constructor
Cary Clarkab2621d2018-01-30 10:08:57 -05001558#Line # constructs, ordering sides from smaller to larger ##
Cary Clark2dc84ad2018-01-26 12:56:22 -05001559Returns IRect with fLeft and fRight swapped if fLeft is greater than fRight; and
Cary Clark0c5f5462017-12-15 11:21:51 -05001560with fTop and fBottom swapped if fTop is greater than fBottom. Result may be empty;
1561and width() and height() will be zero or positive.
1562
1563#Return sorted IRect ##
1564
1565#Example
1566 SkIRect rect = { 30, 50, 20, 10 };
1567 SkDebugf("rect: %d, %d, %d, %d\n", rect.fLeft, rect.fTop, rect.fRight, rect.fBottom);
1568 SkIRect sort = rect.makeSorted();
1569 SkDebugf("sorted: %d, %d, %d, %d\n", sort.fLeft, sort.fTop, sort.fRight, sort.fBottom);
1570#StdOut
1571rect: 30, 50, 20, 10
1572sorted: 20, 10, 30, 50
1573##
1574##
1575
1576#SeeAlso sort SkRect::makeSorted
1577
1578##
1579
1580# ------------------------------------------------------------------------------
1581
1582#Method static const SkIRect& SK_WARN_UNUSED_RESULT EmptyIRect()
1583
Cary Clark4855f782018-02-06 09:41:53 -05001584#In Constructor
Cary Clarkab2621d2018-01-30 10:08:57 -05001585#Line # returns immutable bounds of (0, 0, 0, 0) ##
Cary Clark0c5f5462017-12-15 11:21:51 -05001586Returns a reference to immutable empty IRect, set to (0, 0, 0, 0).
1587
1588#Return global IRect set to all zeroes ##
1589
1590#Example
1591 const SkIRect& rect = SkIRect::EmptyIRect();
1592 SkDebugf("rect: %d, %d, %d, %d\n", rect.fLeft, rect.fTop, rect.fRight, rect.fBottom);
1593#StdOut
1594rect: 0, 0, 0, 0
1595##
1596##
1597
1598#SeeAlso MakeEmpty
1599
1600##
1601
Cary Clark0c95aab2018-01-08 16:20:59 -05001602#Method static SkIRect SK_WARN_UNUSED_RESULT MakeLargest()
Cary Clark0c95aab2018-01-08 16:20:59 -05001603#Deprecated
1604##
1605
Cary Clark0c5f5462017-12-15 11:21:51 -05001606#Struct SkIRect ##
1607
1608#Topic IRect ##