summaryrefslogtreecommitdiff
path: root/libs/ui/Region.cpp
diff options
context:
space:
mode:
author Dan Stoza <stoza@google.com> 2015-04-15 20:26:55 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2015-04-15 20:26:55 +0000
commitfd5f41bee9bcb2df64c39ff0de7d684e43d90d9c (patch)
treec0d4972cfc939f852cc67ea5802fe81863332954 /libs/ui/Region.cpp
parent4d769d8bdc2fd57d34ab0fa4b9208ac0eb67cd61 (diff)
parent5065a55291b67f584d7b0be3fa3cfc4e29a3cd1c (diff)
Merge "libgui: Pass surface damage through BufferQueue"
Diffstat (limited to 'libs/ui/Region.cpp')
-rw-r--r--libs/ui/Region.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/libs/ui/Region.cpp b/libs/ui/Region.cpp
index 62ec35cfc6..3810da4049 100644
--- a/libs/ui/Region.cpp
+++ b/libs/ui/Region.cpp
@@ -53,6 +53,8 @@ enum {
direction_RTL
};
+const Region Region::INVALID_REGION(Rect::INVALID_RECT);
+
// ----------------------------------------------------------------------------
Region::Region() {
@@ -517,8 +519,12 @@ bool Region::validate(const Region& reg, const char* name, bool silent)
Rect b(*prev);
while (cur != tail) {
if (cur->isValid() == false) {
- ALOGE_IF(!silent, "%s: region contains an invalid Rect", name);
- result = false;
+ // We allow this particular flavor of invalid Rect, since it is used
+ // as a signal value in various parts of the system
+ if (*cur != Rect::INVALID_RECT) {
+ ALOGE_IF(!silent, "%s: region contains an invalid Rect", name);
+ result = false;
+ }
}
if (cur->right > region_operator<Rect>::max_value) {
ALOGE_IF(!silent, "%s: rect->right > max_value", name);
@@ -690,7 +696,9 @@ void Region::boolean_operation(int op, Region& dst,
const Region& lhs,
const Rect& rhs, int dx, int dy)
{
- if (!rhs.isValid()) {
+ // We allow this particular flavor of invalid Rect, since it is used as a
+ // signal value in various parts of the system
+ if (!rhs.isValid() && rhs != Rect::INVALID_RECT) {
ALOGE("Region::boolean_operation(op=%d) invalid Rect={%d,%d,%d,%d}",
op, rhs.left, rhs.top, rhs.right, rhs.bottom);
return;