| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkRect_DEFINED | 8 #ifndef SkRect_DEFINED |
| 9 #define SkRect_DEFINED | 9 #define SkRect_DEFINED |
| 10 | 10 |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 r.setLargest(); | 388 r.setLargest(); |
| 389 return r; | 389 return r; |
| 390 } | 390 } |
| 391 | 391 |
| 392 static SkRect SK_WARN_UNUSED_RESULT MakeWH(SkScalar w, SkScalar h) { | 392 static SkRect SK_WARN_UNUSED_RESULT MakeWH(SkScalar w, SkScalar h) { |
| 393 SkRect r; | 393 SkRect r; |
| 394 r.set(0, 0, w, h); | 394 r.set(0, 0, w, h); |
| 395 return r; | 395 return r; |
| 396 } | 396 } |
| 397 | 397 |
| 398 static SkRect SK_WARN_UNUSED_RESULT MakeIWH(int w, int h) { |
| 399 SkRect r; |
| 400 r.set(0, 0, SkIntToScalar(w), SkIntToScalar(h)); |
| 401 return r; |
| 402 } |
| 403 |
| 398 static SkRect SK_WARN_UNUSED_RESULT MakeSize(const SkSize& size) { | 404 static SkRect SK_WARN_UNUSED_RESULT MakeSize(const SkSize& size) { |
| 399 SkRect r; | 405 SkRect r; |
| 400 r.set(0, 0, size.width(), size.height()); | 406 r.set(0, 0, size.width(), size.height()); |
| 401 return r; | 407 return r; |
| 402 } | 408 } |
| 403 | 409 |
| 404 static SkRect SK_WARN_UNUSED_RESULT MakeLTRB(SkScalar l, SkScalar t, SkScala
r r, SkScalar b) { | 410 static SkRect SK_WARN_UNUSED_RESULT MakeLTRB(SkScalar l, SkScalar t, SkScala
r r, SkScalar b) { |
| 405 SkRect rect; | 411 SkRect rect; |
| 406 rect.set(l, t, r, b); | 412 rect.set(l, t, r, b); |
| 407 return rect; | 413 return rect; |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 861 * cast-safe way to treat the rect as an array of (4) SkScalars. | 867 * cast-safe way to treat the rect as an array of (4) SkScalars. |
| 862 */ | 868 */ |
| 863 const SkScalar* asScalars() const { return &fLeft; } | 869 const SkScalar* asScalars() const { return &fLeft; } |
| 864 | 870 |
| 865 void dump(bool asHex) const; | 871 void dump(bool asHex) const; |
| 866 void dump() const { this->dump(false); } | 872 void dump() const { this->dump(false); } |
| 867 void dumpHex() const { this->dump(true); } | 873 void dumpHex() const { this->dump(true); } |
| 868 }; | 874 }; |
| 869 | 875 |
| 870 #endif | 876 #endif |
| OLD | NEW |