summaryrefslogtreecommitdiff
path: root/vulkan/libvulkan/api.cpp
diff options
context:
space:
mode:
author Marin Shalamanov <shalamanov@google.com> 2020-02-12 17:12:22 +0100
committer Marin Shalamanov <shalamanov@google.com> 2020-03-12 13:06:08 +0000
commit4ef0425787f2953a57610fcd53e777b1658c9bc7 (patch)
treefabc80fcf80de776063a84baa648158a7a1b5c6f /vulkan/libvulkan/api.cpp
parented9884cd37bfe1cf29dd25eae0018500139ff762 (diff)
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 ae685593f893e01d95e64bbc08a7147590435dbf)
Diffstat (limited to 'vulkan/libvulkan/api.cpp')
0 files changed, 0 insertions, 0 deletions