summaryrefslogtreecommitdiff
path: root/libs/ui/Rect.cpp
diff options
context:
space:
mode:
author Pablo Ceballos <pceballos@google.com> 2015-08-07 14:47:20 -0700
committer Pablo Ceballos <pceballos@google.com> 2015-08-24 10:50:52 -0700
commit60d6922a011fe18c111b8d30fb6ef1f655b6b15e (patch)
tree4618ad5fc60b4e25c76c9f5d1e80ad3223baff31 /libs/ui/Rect.cpp
parent72f314a50f34de593686661b0a99906125d18bfd (diff)
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
Diffstat (limited to 'libs/ui/Rect.cpp')
-rw-r--r--libs/ui/Rect.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/ui/Rect.cpp b/libs/ui/Rect.cpp
index dcce21f15a..99cbedc2ff 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::transform(uint32_t xform, int32_t width, int32_t height) const {
}
Rect Rect::reduce(const Rect& exclude) const {
- Rect result;
+ Rect result(Rect::EMPTY_RECT);
uint32_t mask = 0;
mask |= (exclude.left > left) ? 1 : 0;