summaryrefslogtreecommitdiff
path: root/libs/ui/include/ui/Rect.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ui/include/ui/Rect.h')
-rw-r--r--libs/ui/include/ui/Rect.h28
1 files changed, 5 insertions, 23 deletions
diff --git a/libs/ui/include/ui/Rect.h b/libs/ui/include/ui/Rect.h
index 9e24a077ff..2f2229e67c 100644
--- a/libs/ui/include/ui/Rect.h
+++ b/libs/ui/include/ui/Rect.h
@@ -19,12 +19,11 @@
#include <ostream>
-#include <log/log.h>
#include <utils/Flattenable.h>
#include <utils/Log.h>
#include <utils/TypeHelpers.h>
+#include <log/log.h>
-#include <math/HashCombine.h>
#include <ui/FloatRect.h>
#include <ui/Point.h>
#include <ui/Size.h>
@@ -203,15 +202,6 @@ public:
// the input.
Rect transform(uint32_t xform, int32_t width, int32_t height) const;
- Rect scale(float scaleX, float scaleY) const {
- return Rect(FloatRect(left * scaleX, top * scaleY, right * scaleX, bottom * scaleY));
- }
-
- Rect& scaleSelf(float scaleX, float scaleY) {
- set(scale(scaleX, scaleY));
- return *this;
- }
-
// this calculates (Region(*this) - exclude).bounds() efficiently
Rect reduce(const Rect& exclude) const;
@@ -226,22 +216,14 @@ public:
}
};
-std::string to_string(const android::Rect& rect);
-
// Defining PrintTo helps with Google Tests.
-void PrintTo(const Rect& rect, ::std::ostream* os);
+static inline void PrintTo(const Rect& rect, ::std::ostream* os) {
+ *os << "Rect(" << rect.left << ", " << rect.top << ", " << rect.right << ", " << rect.bottom
+ << ")";
+}
ANDROID_BASIC_TYPES_TRAITS(Rect)
}; // namespace android
-namespace std {
-template <>
-struct hash<android::Rect> {
- size_t operator()(const android::Rect& rect) const {
- return android::hashCombine(rect.left, rect.top, rect.right, rect.bottom);
- }
-};
-} // namespace std
-
#endif // ANDROID_UI_RECT