set correct crop rectangle in LayerBase::setCrop
The crop always had left=top=0, because the crop position
and the layer's transform were merged together in
computeBounds() (which really used to compute the
bounds in screen space, which we usually call the
"frame" elsewhere in the code)
Note: in practice this crop value is not used by
hwc, because it's overridden in Layer::setGeometry(), which
is why this bug was never apparent.
Change-Id: I1ec6400a8fc8314408e4252708f43ea98c2fe64e
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index ee3e93b..bdeffdf 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -1384,7 +1384,7 @@
// handle hidden surfaces by setting the visible region to empty
if (CC_LIKELY(layer->isVisible())) {
const bool translucent = !layer->isOpaque();
- Rect bounds(layer->computeBounds());
+ Rect bounds(s.transform.transform(layer->computeBounds()));
visibleRegion.set(bounds);
if (!visibleRegion.isEmpty()) {
// Remove the transparent area from the visible region