diff options
author | 2021-04-20 00:42:31 +0000 | |
---|---|---|
committer | 2021-04-20 00:42:31 +0000 | |
commit | 7d54b9ca2da6b284c53df8f08a22bd1dc1af37d8 (patch) | |
tree | a112535ad876ff2218515c073a22bca70a5f6cf1 /libs/gui/SurfaceComposerClient.cpp | |
parent | f7891609c94da133f23706cdb262c32fa895eaa9 (diff) | |
parent | 5b3b9146e0e038411fb72e411853d7d79d853ae5 (diff) |
Merge "SurfaceFlinger: Prepare to remove BufferQueueLayer" into sc-dev
Diffstat (limited to 'libs/gui/SurfaceComposerClient.cpp')
-rw-r--r-- | libs/gui/SurfaceComposerClient.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp index e6baba6e1d..6d198a105f 100644 --- a/libs/gui/SurfaceComposerClient.cpp +++ b/libs/gui/SurfaceComposerClient.cpp @@ -896,7 +896,7 @@ void SurfaceComposerClient::Transaction::setEarlyWakeupEnd() { } layer_state_t* SurfaceComposerClient::Transaction::getLayerState(const sp<SurfaceControl>& sc) { - auto handle = sc->getHandle(); + auto handle = sc->getLayerStateHandle(); if (mComposerStates.count(handle) == 0) { // we don't have it, add an initialized layer_state to our list @@ -1147,8 +1147,11 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::reparent mStatus = BAD_INDEX; return *this; } + if (SurfaceControl::isSameSurface(sc, newParent)) { + return *this; + } s->what |= layer_state_t::eReparent; - s->parentSurfaceControlForChild = newParent; + s->parentSurfaceControlForChild = newParent ? newParent->getParentingLayer() : nullptr; registerSurfaceControlForCallback(sc); return *this; @@ -1793,7 +1796,7 @@ status_t SurfaceComposerClient::createSurfaceChecked(const String8& name, uint32 } ALOGE_IF(err, "SurfaceComposerClient::createSurface error %s", strerror(-err)); if (err == NO_ERROR) { - *outSurface = new SurfaceControl(this, handle, gbp, id, transformHint); + *outSurface = new SurfaceControl(this, handle, gbp, id, w, h, format, transformHint); } } return err; |