summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--services/surfaceflinger/Layer.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 93e6bda..6dd8bad 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -326,7 +326,9 @@ Rect Layer::reduce(const Rect& win, const Region& exclude) const{
if (CC_LIKELY(exclude.isEmpty())) {
return win;
}
- if (exclude.isRect()) {
+ Rect tmp;
+ win.intersect(exclude.getBounds(), &tmp);
+ if (exclude.isRect() && !tmp.isEmpty()) {
return win.reduce(exclude.getBounds());
}
return Region(win).subtract(exclude).getBounds();