diff options
| author | 2017-05-17 14:36:16 -0700 | |
|---|---|---|
| committer | 2017-05-18 08:35:46 -0700 | |
| commit | 3851225fddb6f1755a8034aa7a9f9ae7397b56a9 (patch) | |
| tree | 3babdae8f15993979ab041ce21bc0bdba70409f7 | |
| parent | fb8cedea2730603d6bf95dd10466b2f2660ade9d (diff) | |
surfaceflinger: clear HWC layers in Layer::onRemoved v2
Explicitly destroy HWC layers in Layer::onRemoved rather than doing
that implicitly in the destructor. The layer may be destructed by
any thread that holds a sp<Layer>, but only the main thread should
talk to the composer.
v2 fixes build breakage for non-HWC2 targets.
Bug: 38151478
Bug: 37978067
Test: manual
Change-Id: I8858fc46de1fc6facded219740b931c6486e317e
| -rw-r--r-- | services/surfaceflinger/Layer.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index 06a0765719..fe16b763c2 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -296,6 +296,11 @@ void Layer::onRemoved() { } mSurfaceFlingerConsumer->abandon(); + +#ifdef USE_HWC2 + clearHwcLayers(); +#endif + for (const auto& child : mCurrentChildren) { child->onRemoved(); } |