OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef SkRect_DEFINED | 10 #ifndef SkRect_DEFINED |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 rect.set(l, t, r, b); | 394 rect.set(l, t, r, b); |
395 return rect; | 395 return rect; |
396 } | 396 } |
397 | 397 |
398 static SkRect SK_WARN_UNUSED_RESULT MakeXYWH(SkScalar x, SkScalar y, SkScala
r w, SkScalar h) { | 398 static SkRect SK_WARN_UNUSED_RESULT MakeXYWH(SkScalar x, SkScalar y, SkScala
r w, SkScalar h) { |
399 SkRect r; | 399 SkRect r; |
400 r.set(x, y, x + w, y + h); | 400 r.set(x, y, x + w, y + h); |
401 return r; | 401 return r; |
402 } | 402 } |
403 | 403 |
404 // DEPRECATED: call Make(r) | 404 SK_ATTR_DEPRECATED("use Make()") |
405 static SkRect SK_WARN_UNUSED_RESULT MakeFromIRect(const SkIRect& irect) { | 405 static SkRect SK_WARN_UNUSED_RESULT MakeFromIRect(const SkIRect& irect) { |
406 SkRect r; | 406 SkRect r; |
407 r.set(SkIntToScalar(irect.fLeft), | 407 r.set(SkIntToScalar(irect.fLeft), |
408 SkIntToScalar(irect.fTop), | 408 SkIntToScalar(irect.fTop), |
409 SkIntToScalar(irect.fRight), | 409 SkIntToScalar(irect.fRight), |
410 SkIntToScalar(irect.fBottom)); | 410 SkIntToScalar(irect.fBottom)); |
411 return r; | 411 return r; |
412 } | 412 } |
413 | 413 |
414 static SkRect SK_WARN_UNUSED_RESULT Make(const SkIRect& irect) { | 414 static SkRect SK_WARN_UNUSED_RESULT Make(const SkIRect& irect) { |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 */ | 781 */ |
782 void sort(); | 782 void sort(); |
783 | 783 |
784 /** | 784 /** |
785 * cast-safe way to treat the rect as an array of (4) SkScalars. | 785 * cast-safe way to treat the rect as an array of (4) SkScalars. |
786 */ | 786 */ |
787 const SkScalar* asScalars() const { return &fLeft; } | 787 const SkScalar* asScalars() const { return &fLeft; } |
788 }; | 788 }; |
789 | 789 |
790 #endif | 790 #endif |
OLD | NEW |