summaryrefslogtreecommitdiff
path: root/libs/gui/SurfaceComposerClient.cpp
diff options
context:
space:
mode:
author Robert Carr <racarr@google.com> 2021-02-22 12:27:32 -0800
committer Rob Carr <racarr@google.com> 2021-04-15 23:49:01 +0000
commit5b3b9146e0e038411fb72e411853d7d79d853ae5 (patch)
tree12a21d9e3366d01c6746921877f852a64862d020 /libs/gui/SurfaceComposerClient.cpp
parent0e4c8a4648f7c7e44ebd7ddd7c02302744334df6 (diff)
SurfaceFlinger: Prepare to remove BufferQueueLayer
To prepare to remove BufferQueueLayer we port over the public Java API (getSurface) and a few remaining clients (largely tests), by returning a BBQ from getSurface. Bug: 185492007 Test: Existing tests pass Change-Id: I0ec0d765659783e1bdbb3f243ad60e3355cfdf4f
Diffstat (limited to 'libs/gui/SurfaceComposerClient.cpp')
-rw-r--r--libs/gui/SurfaceComposerClient.cpp9
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;