libsgui: Change Rect default constructor
The current Rect default constructor initializes to all zeroes. Change
it to initialize to an invalid Rect.
Modify all of the existing invocations of the default constructor to
maintain the existing behavior.
Bug 18173359
Change-Id: Ibbad076f1550a94f56d7b1cf5350071f2022e09a
diff --git a/libs/ui/Rect.cpp b/libs/ui/Rect.cpp
index dcce21f..99cbedc 100644
--- a/libs/ui/Rect.cpp
+++ b/libs/ui/Rect.cpp
@@ -20,6 +20,7 @@
namespace android {
const Rect Rect::INVALID_RECT{0, 0, -1, -1};
+const Rect Rect::EMPTY_RECT{0, 0, 0, 0};
static inline int32_t min(int32_t a, int32_t b) {
return (a < b) ? a : b;
@@ -110,7 +111,7 @@
}
Rect Rect::reduce(const Rect& exclude) const {
- Rect result;
+ Rect result(Rect::EMPTY_RECT);
uint32_t mask = 0;
mask |= (exclude.left > left) ? 1 : 0;