diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-04-12 10:07:15 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-04-12 10:07:15 +0000 |
commit | 437240699aaa0dfe3bfdf2f2a59e4a1cc95bc971 (patch) | |
tree | 992d95bf1faa3bc1751b4906849ce9913beb08da | |
parent | c2d8c62c743da5ba1bb6b8a40cf066ff0b607eb6 (diff) | |
parent | ab9fd81c5e8fe736318fdf67a06d58ada737764d (diff) |
Snap for 8437239 from ab9fd81c5e8fe736318fdf67a06d58ada737764d to s-keystone-qcom-release
Change-Id: Ib42ddcb39d7d3d416c7a3b1fa93ef832b5db9b90
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 04b49325d2..80b92b2aa5 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -4003,33 +4003,29 @@ void SurfaceFlinger::setFrameBufferSizeForScaling(sp<DisplayDevice> displayDevic auto display = displayDevice->getCompositionDisplay(); int newWidth = currentState.layerStackSpaceRect.width(); int newHeight = currentState.layerStackSpaceRect.height(); - int currentWidth = drawingState.layerStackSpaceRect.width(); - int currentHeight = drawingState.layerStackSpaceRect.height(); int displayWidth = displayDevice->getWidth(); int displayHeight = displayDevice->getHeight(); - bool update_needed = false; - if (newWidth != currentWidth || newHeight != currentHeight) { - update_needed = true; + if (newWidth != displayWidth || newHeight != displayHeight) { if (!((newWidth > newHeight && displayWidth > displayHeight) || (newWidth < newHeight && displayWidth < displayHeight))) { std::swap(newWidth, newHeight); } } - if (displayDevice->getWidth() == newWidth && displayDevice->getHeight() == newHeight && - !update_needed) { - displayDevice->setProjection(currentState.orientation, currentState.layerStackSpaceRect, - currentState.orientedDisplaySpaceRect); - return; - } - if (newWidth > 0 && newHeight > 0) { currentState.width = newWidth; currentState.height = newHeight; } + currentState.orientedDisplaySpaceRect = currentState.layerStackSpaceRect; + if (displayWidth == newWidth && displayHeight == newHeight) { + displayDevice->setProjection(currentState.orientation, currentState.layerStackSpaceRect, + currentState.orientedDisplaySpaceRect); + return; + } + if (mBootStage == BootStage::FINISHED) { displayDevice->setDisplaySize(currentState.width, currentState.height); displayDevice->setProjection(currentState.orientation, currentState.layerStackSpaceRect, |