diff options
author | Padmanabhan Komanduru <quic_pkomandu@quicinc.com> | 2022-04-01 13:24:48 +0530 |
---|---|---|
committer | Thirupathi Reddy R <quic_treddyr@quicinc.com> | 2022-04-12 12:21:35 +0530 |
commit | 7249b8580a8e2921c1a8cc624f321390a80370b7 (patch) | |
tree | a8ee06a8c0da4e4a5aaa65e7c1da335e71edccdf | |
parent | 6c764fa7a0120ca28b12362cd50abe0c201f0f07 (diff) |
sf: compare current FB and layer stack params for FB resolution change
Change-Id: I75a452004f5632f49900648fbe1d851bcc358328
CRs-Fixed: 3171148
-rwxr-xr-x | 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 3aef19320c..a8a0bab62d 100755 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -4005,33 +4005,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, |