OSDN Git Service

surfaceflinger: fix initial crop computation
authorChia-I Wu <olv@google.com>
Thu, 20 Jul 2017 21:24:37 +0000 (14:24 -0700)
committerChia-I Wu <olv@google.com>
Thu, 20 Jul 2017 21:30:39 +0000 (14:30 -0700)
This function computes the crop of the layer, that is, the region of
the layer to be drawn.  We must consider the size of the layer when
applying s.active.crop.

Bug: 63786936
Test: manual
Change-Id: I8000413beba54a054db8d7ad28e868d23b0167ab

services/surfaceflinger/Layer.cpp

index 0597556..1b864fd 100755 (executable)
@@ -474,7 +474,7 @@ Rect Layer::computeInitialCrop(const sp<const DisplayDevice>& hw) const {
 
     Rect activeCrop(s.active.w, s.active.h);
     if (!s.crop.isEmpty()) {
-        activeCrop = s.crop;
+        activeCrop.intersect(s.crop, &activeCrop);
     }
 
     Transform t = getTransform();