diff options
author | 2017-01-10 16:42:54 -0800 | |
---|---|---|
committer | 2017-02-27 10:20:10 -0800 | |
commit | 0d48072f6047140119ff194c1194ce402fca2c0b (patch) | |
tree | 3db72861fcac7b9a1622d3f7d75d54bcba2e22b3 /libs/gui/SurfaceComposerClient.cpp | |
parent | e7f1979d8180ff9ab10422da2020e77fafe8d7d6 (diff) |
Add deferTransaction variant taking GraphicBufferProducer.
For SurfaceView using child layers, the client framework
will not have access to the Handle* for the parent surface,
but still needs a way to defer transactions to it's frames.
Test: Tested with corresponding SurfaceView modifications and existing tests.
Change-Id: I6f01c360e85a95ff0ab08db406741221152e5d5c
Diffstat (limited to 'libs/gui/SurfaceComposerClient.cpp')
-rw-r--r-- | libs/gui/SurfaceComposerClient.cpp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp index ae81c8fbd1..fd277f1beb 100644 --- a/libs/gui/SurfaceComposerClient.cpp +++ b/libs/gui/SurfaceComposerClient.cpp @@ -38,6 +38,7 @@ #include <gui/IGraphicBufferProducer.h> #include <gui/ISurfaceComposer.h> #include <gui/ISurfaceComposerClient.h> +#include <gui/Surface.h> #include <gui/SurfaceComposerClient.h> #include <private/gui/ComposerService.h> @@ -168,6 +169,9 @@ public: status_t deferTransactionUntil(const sp<SurfaceComposerClient>& client, const sp<IBinder>& id, const sp<IBinder>& handle, uint64_t frameNumber); + status_t deferTransactionUntil(const sp<SurfaceComposerClient>& client, + const sp<IBinder>& id, const sp<Surface>& barrierSurface, + uint64_t frameNumber); status_t reparentChildren(const sp<SurfaceComposerClient>& client, const sp<IBinder>& id, const sp<IBinder>& newParentHandle); @@ -439,7 +443,21 @@ status_t Composer::deferTransactionUntil( return BAD_INDEX; } s->what |= layer_state_t::eDeferTransaction; - s->handle = handle; + s->barrierHandle = handle; + s->frameNumber = frameNumber; + return NO_ERROR; +} + +status_t Composer::deferTransactionUntil( + const sp<SurfaceComposerClient>& client, const sp<IBinder>& id, + const sp<Surface>& barrierSurface, uint64_t frameNumber) { + Mutex::Autolock lock(mLock); + layer_state_t* s = getLayerStateLocked(client, id); + if (!s) { + return BAD_INDEX; + } + s->what |= layer_state_t::eDeferTransaction; + s->barrierGbp = barrierSurface->getIGraphicBufferProducer(); s->frameNumber = frameNumber; return NO_ERROR; } @@ -777,6 +795,11 @@ status_t SurfaceComposerClient::deferTransactionUntil(const sp<IBinder>& id, return getComposer().deferTransactionUntil(this, id, handle, frameNumber); } +status_t SurfaceComposerClient::deferTransactionUntil(const sp<IBinder>& id, + const sp<Surface>& barrierSurface, uint64_t frameNumber) { + return getComposer().deferTransactionUntil(this, id, barrierSurface, frameNumber); +} + status_t SurfaceComposerClient::reparentChildren(const sp<IBinder>& id, const sp<IBinder>& newParentHandle) { return getComposer().reparentChildren(this, id, newParentHandle); |