From 41b08b5e97b04d726fb8bbacddbce563a1c890f9 Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Thu, 1 Jun 2017 16:11:34 -0700 Subject: SurfaceFlinger: Fix final cropping of child layers. Straightforward mistake documented by the test case. Not sure how it made it this long. Test: Included in Transaction_test.cpp. Manual from bug. go/wm-smoke. Bug: 37511473 Change-Id: I87a57825cca879c5519fe72fef199168f7c23479 --- services/surfaceflinger/Layer.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'services/surfaceflinger/Layer.cpp') diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index c21f0c26a1..6f430a386f 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -399,6 +399,10 @@ Rect Layer::computeScreenBounds(bool reduceTransparentRegion) const { Transform t = getTransform(); win = t.transform(win); + if (!s.finalCrop.isEmpty()) { + win.intersect(s.finalCrop, &win); + } + const sp& p = getParent(); // Now we need to calculate the parent bounds, so we can clip ourselves to those. // When calculating the parent bounds for purposes of clipping, -- cgit v1.2.3-59-g8ed1b