From 5065a55291b67f584d7b0be3fa3cfc4e29a3cd1c Mon Sep 17 00:00:00 2001 From: Dan Stoza Date: Tue, 17 Mar 2015 16:23:42 -0700 Subject: libgui: Pass surface damage through BufferQueue This change adds support for passing surface damage all of the way down from the EGL interface through the consumer side of the BufferQueue. Depends on system/core change Ie645e6a52b37b5c1b3be19481e8348570d1aa62c Bug: 11239309 Change-Id: I4457ea826e9ade4ec187f973851d855b7b93a31b --- libs/ui/Region.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'libs/ui/Region.cpp') 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::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; -- cgit v1.2.3-59-g8ed1b