diff options
author | 2024-08-02 09:55:23 -0500 | |
---|---|---|
committer | 2024-08-06 09:58:17 -0500 | |
commit | f693bcf2ee13391f99b8ede5562047981e1f5968 (patch) | |
tree | 4a543a7b58d2dcff1c728f3af5e00be4f016bc34 /libs/gui/SurfaceComposerClient.cpp | |
parent | f5b42de949b928d5b08854a592c2af0600bbca7b (diff) |
Add BufferReleaseChannel
BufferReleaseChannel will be used to communicate buffer releases from SurfaceFlinger to BLASTBufferQueue.
Bug: 294133380
Flag: com.android.graphics.libgui.flags.buffer_release_channel
Test: BufferReleaseChannelTest
Change-Id: Ic38e8eefc96abc0b2bbe780115b7628413e8b829
Diffstat (limited to 'libs/gui/SurfaceComposerClient.cpp')
-rw-r--r-- | libs/gui/SurfaceComposerClient.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp index f663600f9e..b5d9366185 100644 --- a/libs/gui/SurfaceComposerClient.cpp +++ b/libs/gui/SurfaceComposerClient.cpp @@ -2390,6 +2390,22 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setDropI return *this; } +SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setBufferReleaseChannel( + const sp<SurfaceControl>& sc, + const std::shared_ptr<gui::BufferReleaseChannel::ProducerEndpoint>& channel) { + layer_state_t* s = getLayerState(sc); + if (!s) { + mStatus = BAD_INDEX; + return *this; + } + + s->what |= layer_state_t::eBufferReleaseChannelChanged; + s->bufferReleaseChannel = channel; + + registerSurfaceControlForCallback(sc); + return *this; +} + // --------------------------------------------------------------------------- DisplayState& SurfaceComposerClient::Transaction::getDisplayState(const sp<IBinder>& token) { |