summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorradhakrishna <radhakrishna@codeaurora.org>2014-02-21 10:01:08 +0530
committerSteve Kondik <steve@cyngn.com>2015-12-16 00:16:12 -0500
commit5934c292abffd0942ffad65aa352476de9df1245 (patch)
tree114c33545fbd70b3218a99e1cda8b0c6a3055787 /services
parentbea57f312dbbeef1d35cb41948605a41b3f30662 (diff)
downloadframeworks_native-5934c292abffd0942ffad65aa352476de9df1245.zip
frameworks_native-5934c292abffd0942ffad65aa352476de9df1245.tar.gz
frameworks_native-5934c292abffd0942ffad65aa352476de9df1245.tar.bz2
SF: Fix invalid reduction of transparent region from a layer.
Reduce transparent region from a layer only if the transparent region has valid intersection with the layer. Otherwise, reducing a transparent region lying completely outside of the layer leads to invalid sourcecrop values for the layer. Change-Id: Iee9ba53a8072c21c9ba8a6d58cb14ca30f8600ba CRs-Fixed: 620973
Diffstat (limited to 'services')
-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();