diff options
| author | 2018-11-16 16:08:10 -0800 | |
|---|---|---|
| committer | 2018-11-26 17:34:00 -0800 | |
| commit | dcec0bca4da5ab98384bb6e0b40757cf688583eb (patch) | |
| tree | 13638036eead451a95521d0fd5a39c1170532c7a /libs/input/InputWindow.cpp | |
| parent | 3e7cf73066c3d1f0acbd69c2cdd3855544d22ab5 (diff) | |
SF: Clear mCompositionInfo before recomputing visible layers
Both SurfaceFlingerBE::mCompositionInfo and LayerBE::HWCInfo can hold a
shared_ptr to the same HWC2::Layer.
However the lifetime of the HWC2::Layer is only really expected to last
as long as the Layer is referenced by the visible layer list for a
display. This list might be the last thing keeping a sp<Layer> alive,
and when it is removed from the list, cleanup occurs.
The Layer dtor invokes Layer::destroyAllLayers(), which asserts that
cleanup completes succesfully. Effectively it requires that the
HWC2::Layer instance it holds is destroyed, as when it does so the
HWC2::Layer dtor invokes a callback to remove the entry from
LayerBE::HWCInfo for the display.
This fails to happen if the reference count for the shared_ptr does not
drop to zero. Clearing out mCompositionInfo before the visible layers
are recomputed fixes this.
Bug: 119629556
Test: atest CtsViewTestCases
Change-Id: I9b0ea0389fc1ba22a2a230f165689b5ee2f474ce
Diffstat (limited to 'libs/input/InputWindow.cpp')
0 files changed, 0 insertions, 0 deletions