From ca27f2500cff74ae1e08b3ae06f18e9b3414ffb7 Mon Sep 17 00:00:00 2001 From: chaviw Date: Tue, 6 Feb 2018 16:46:39 -0800 Subject: Allow destroySurface to get called in transaction. Previously, destroy was always initiated immediatley and could not be synchronized with a client transaction. This change allows destroySurface to be called in the same transaction as other client state updates. Test: Unit tests pass Test: Call from Java fixes bugs. Change-Id: I841359530538961a0187216cc455cc388c0ede77 Fixes: 72953020 Fixes: 71499373 --- libs/gui/SurfaceComposerClient.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'libs/gui/SurfaceComposerClient.cpp') diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp index c40cad3e99..0722038c5b 100644 --- a/libs/gui/SurfaceComposerClient.cpp +++ b/libs/gui/SurfaceComposerClient.cpp @@ -472,6 +472,17 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setGeome return *this; } +SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::destroySurface( + const sp& sc) { + layer_state_t* s = getLayerStateLocked(sc); + if (!s) { + mStatus = BAD_INDEX; + return *this; + } + s->what |= layer_state_t::eDestroySurface; + return *this; +} + // --------------------------------------------------------------------------- DisplayState& SurfaceComposerClient::Transaction::getDisplayStateLocked(const sp& token) { -- cgit v1.2.3-59-g8ed1b