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 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 if (fTop > fBottom) { | 855 if (fTop > fBottom) { |
856 SkTSwap<SkScalar>(fTop, fBottom); | 856 SkTSwap<SkScalar>(fTop, fBottom); |
857 } | 857 } |
858 } | 858 } |
859 | 859 |
860 /** | 860 /** |
861 * cast-safe way to treat the rect as an array of (4) SkScalars. | 861 * cast-safe way to treat the rect as an array of (4) SkScalars. |
862 */ | 862 */ |
863 const SkScalar* asScalars() const { return &fLeft; } | 863 const SkScalar* asScalars() const { return &fLeft; } |
864 | 864 |
865 #ifdef SK_DEVELOPER | 865 void dump(bool asHex) const; |
866 /** | 866 void dump() const { this->dump(false); } |
867 * Dumps the rect using SkDebugf. This is intended for Skia development debu
gging. Don't | 867 void dumpHex() const { this->dump(true); } |
868 * rely on the existence of this function or the formatting of its output. | |
869 */ | |
870 void dump() const { | |
871 SkDebugf("{ l: %f, t: %f, r: %f, b: %f }", fLeft, fTop, fRight, fBottom)
; | |
872 } | |
873 #endif | |
874 | |
875 }; | 868 }; |
876 | 869 |
877 #endif | 870 #endif |
OLD | NEW |