diff options
author | Chris Gross <chrisgross@google.com> | 2021-05-19 11:39:13 -0700 |
---|---|---|
committer | Scott Lobdell <slobdell@google.com> | 2021-05-21 00:34:23 +0000 |
commit | 219787565ff982848d596fa8743cd132af113e6b (patch) | |
tree | 93bd3c94771fb966fdf611d38865e712fb83e969 /native/android/surface_control.cpp | |
parent | 7b4a006d559a571313e36799d93af7e3c6b69c82 (diff) | |
parent | 75eb1dd292d1800d660c5146464264b25854d318 (diff) |
Merge SP1A.210513.004
Change-Id: Ic23aece12c3bbd2b4dcf3205fdbcdd1601deabec
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; |