diff options
author | Vishnu Nair <vishnun@google.com> | 2021-05-12 00:24:59 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2021-05-12 00:24:59 +0000 |
commit | 6438998d643422c3175665672507b745ff8bc58f (patch) | |
tree | 9212755d8e7edbd5e69e78e926b980875b4d95ec /native/android/surface_control.cpp | |
parent | 0723998726a06af23a201bc739e3ebea3b55e3c9 (diff) | |
parent | 0d7aff7b35de87347a1c9871acf20b9954ba4106 (diff) |
Merge "Remove rotation based scaling" into sc-dev
Diffstat (limited to 'native/android/surface_control.cpp')
-rw-r--r-- | native/android/surface_control.cpp | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/native/android/surface_control.cpp b/native/android/surface_control.cpp index a8c2ea544d38..93a54445a033 100644 --- a/native/android/surface_control.cpp +++ b/native/android/surface_control.cpp @@ -454,28 +454,7 @@ void ASurfaceTransaction_setGeometry(ASurfaceTransaction* aSurfaceTransaction, sourceRect.makeInvalid(); } transaction->setBufferCrop(surfaceControl, sourceRect); - - int destW = destRect.width(); - int destH = destRect.height(); - if (destRect.left < 0) { - destRect.left = 0; - destRect.right = destW; - } - if (destRect.top < 0) { - destRect.top = 0; - destRect.bottom = destH; - } - - if (!sourceRect.isEmpty()) { - float sx = destW / static_cast<float>(sourceRect.width()); - float sy = destH / static_cast<float>(sourceRect.height()); - transaction->setPosition(surfaceControl, destRect.left - (sourceRect.left * sx), - destRect.top - (sourceRect.top * sy)); - transaction->setMatrix(surfaceControl, sx, 0, 0, sy); - } else { - transaction->setPosition(surfaceControl, destRect.left, destRect.top); - } - + transaction->setDestinationFrame(surfaceControl, destRect); transaction->setTransform(surfaceControl, transform); bool transformToInverseDisplay = (NATIVE_WINDOW_TRANSFORM_INVERSE_DISPLAY & transform) == NATIVE_WINDOW_TRANSFORM_INVERSE_DISPLAY; |