Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 4ef04257 authored by Marin Shalamanov's avatar Marin Shalamanov
Browse files

SF: Refactor processDisplayChangesLocked()

This change introduces three new functions:
 * processAddedDisplay()
 * processRemovedDisplay()
 * processChangedDisplay()
and refactors processDisplayChangesLocked(). Where code reuse
is required the appropriate function is called.

Context:

SurfaceFlinger::processDisplayChangesLocked() is a 150 line
function, which does a non-trivial iteration of mCurrentState
and mDisplayState, detects added, removed and changed displays
and executes the corresponding logic to handle the changes.

Currently if the surface of a display is different in curr and
drawing state the code is destroying and recreatig the display
object. The logic for display (re)creation is reused by playing
with the iterator (skipping i++) and modifying the iterated
collection (mDrawingState). This makes the code unnecessary
complex and unreadable.

Bug: 143451809
Test: flash device and check it boots
Test: atest libsurfaceflinger_unittest
Change-Id: I03afda7c1807ab36f8e03e7a4e43c804b3199149
(cherry picked from commit ae685593)
parent ed9884cd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment