From f03652dd9df88182518a7046cf542076ea10d5ea Mon Sep 17 00:00:00 2001 From: Vishnu Nair Date: Tue, 16 Jul 2019 17:56:56 -0700 Subject: Store layer state changes by layer handle in Transaction objects Layer state changes are stored in an unordered map with the surface control as the key and state changes as the value. This causes a few problems when merging the transactions. If transactions contained state changes from a cloned surface control then it will not be merged. This will cause ordering issues when the transaction is applied since the changes are stored in and unordered map. When parcelling transactions, a new surface control is created from the existing one and this surfaces the problem more frequently. Instead we store the layer changes by the layer handle which is consistent across processes. Test: atest SurfaceFlinger_test Test: go/wm-smoke Change-Id: I2e041d70ae24db2c1f26ada003532ad97f667167 --- libs/gui/SurfaceControl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libs/gui/SurfaceControl.cpp') diff --git a/libs/gui/SurfaceControl.cpp b/libs/gui/SurfaceControl.cpp index b9defdd120..071314f082 100644 --- a/libs/gui/SurfaceControl.cpp +++ b/libs/gui/SurfaceControl.cpp @@ -65,8 +65,8 @@ SurfaceControl::~SurfaceControl() { // Avoid reparenting the server-side surface to null if we are not the owner of it, // meaning that we retrieved it from another process. - if (mClient != nullptr && mHandle != nullptr && mOwned) { - SurfaceComposerClient::doDropReferenceTransaction(mHandle, mClient->getClient()); + if (mHandle != nullptr && mOwned) { + SurfaceComposerClient::doDropReferenceTransaction(mHandle); } release(); } -- cgit v1.2.3-59-g8ed1b