summaryrefslogtreecommitdiff
path: root/libs/gui/ConsumerBase.cpp
diff options
context:
space:
mode:
author Dan Stoza <stoza@google.com> 2017-06-01 16:40:30 -0700
committer Dan Stoza <stoza@google.com> 2017-07-14 11:15:22 -0700
commit2b6d38e8eca1fe7137757b8269c6c19c6d1a04e4 (patch)
tree3b78efffce088a7a0098a89c21e5de9a67171790 /libs/gui/ConsumerBase.cpp
parentabcda352f126016ce4dd227d34088e8c7957c32e (diff)
SF: Move screenshot Surface ops off main thread
This change rearranges the various operations that correspond to capturing a screenshot such that all of the Surface-related ones (connect, dequeue, queue, disconnect) are performed on the incoming Binder thread rather than on SurfaceFlinger's main thread. This has two major benefits: 1) It reduces the amount of time that the SurfaceFlinger main thread is blocked while performing a screenshot, often by a considerable amount. This should reduce the risk of jank when screenshots are taken, such as for task snapshots during window transitions. 2) It means that the SurfaceFlinger main thread is not susceptible to being blocked by a badly-performing BufferQueue consumer. This also enables us to remove the GraphicProducerWrapper class, which was previously performing a similar role. Finally, this change also adds a mechanism that detects if the screenshot would have been performed between the two phases of normal SurfaceFlinger operation (invalidate and refresh), and defers it if this condition is detected. This should further reduce the risk of jank as a screenshot will only occur between frames rather than in the middle of a frame. Bug: 62257775 Test: SurfaceFlinger_test and manual verification that screenshots still work Change-Id: I23e6f088b4d6e477472dfc2a6c36ef3dd930c047
Diffstat (limited to 'libs/gui/ConsumerBase.cpp')
0 files changed, 0 insertions, 0 deletions