From 9b2ac24f09d052ed160d520699386d82272e48a6 Mon Sep 17 00:00:00 2001 From: chaviw Date: Tue, 27 Apr 2021 15:52:09 -0500 Subject: [PATCH] Added setBufferCrop to setGeometry The crop being sent to SF is in layer space where the setGeometry API is getting buffer space crop. This breaks the API behavior so call setBufferCrop instead of setCrop Test: ASurfaceControlTest Fixes: 186266903 Change-Id: I8f2567aa41b9525c3c3dc08855d14d8a9b11c7e2 --- native/android/surface_control.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/android/surface_control.cpp b/native/android/surface_control.cpp index 087837a5c70f1..7540a143c2f37 100644 --- a/native/android/surface_control.cpp +++ b/native/android/surface_control.cpp @@ -449,7 +449,7 @@ void ASurfaceTransaction_setGeometry(ASurfaceTransaction* aSurfaceTransaction, sp surfaceControl = ASurfaceControl_to_SurfaceControl(aSurfaceControl); Transaction* transaction = ASurfaceTransaction_to_Transaction(aSurfaceTransaction); - transaction->setCrop(surfaceControl, sourceRect); + transaction->setBufferCrop(surfaceControl, sourceRect); float dsdx = (destination.right - destination.left) / static_cast(sourceRect.right - sourceRect.left);