Added setBufferCrop
Added setBufferCrop to handle setGeometry calls from the public
SurfaceControl. This is because setGeometry gets crop in buffer space,
but setCrop can only handle layer space crop. Added setBufferCrop to
handle this case
Test: ASurfaceControlTest
Fixes: 186266903
Change-Id: I14fb329d2d6f504ca8fa8e330c8a036cbde56f28
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index b048682..2dace92 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -4033,6 +4033,11 @@
flags |= eTraversalNeeded;
}
}
+ if (what & layer_state_t::eBufferCropChanged) {
+ if (layer->setBufferCrop(s.bufferCrop)) {
+ flags |= eTraversalNeeded;
+ }
+ }
// This has to happen after we reparent children because when we reparent to null we remove
// child layers from current state and remove its relative z. If the children are reparented in
// the same transaction, then we have to make sure we reparent the children first so we do not