diff options
author | Wonsik Kim <wonsik@google.com> | 2014-03-31 23:16:08 +0900 |
---|---|---|
committer | Wonsik Kim <wonsik@google.com> | 2014-04-07 15:59:22 +0900 |
commit | afe3081e0e224a3d88da2e8f211e994f833cc6bb (patch) | |
tree | 3217e0bec74a981328bdeb23eb1fd7976df36eca | |
parent | 2e1f4b5212ccc1b2091e44396e051f033929cee4 (diff) | |
download | frameworks_native-afe3081e0e224a3d88da2e8f211e994f833cc6bb.zip frameworks_native-afe3081e0e224a3d88da2e8f211e994f833cc6bb.tar.gz frameworks_native-afe3081e0e224a3d88da2e8f211e994f833cc6bb.tar.bz2 |
Fix sideband stream issues
- Notify a listener when sideband stream is set
- Mark a layer as visible when sideband stream is set, even though
no buffer is queued.
Change-Id: I9652bf530f2b5ce331533ec1bb3b10a815ca191c
-rw-r--r-- | libs/gui/BufferQueueProducer.cpp | 12 | ||||
-rw-r--r-- | services/surfaceflinger/Layer.cpp | 2 |
2 files changed, 11 insertions, 3 deletions
diff --git a/libs/gui/BufferQueueProducer.cpp b/libs/gui/BufferQueueProducer.cpp index 9dd90ba..249b7c7 100644 --- a/libs/gui/BufferQueueProducer.cpp +++ b/libs/gui/BufferQueueProducer.cpp @@ -793,8 +793,16 @@ status_t BufferQueueProducer::disconnect(int api) { } status_t BufferQueueProducer::setSidebandStream(const sp<NativeHandle>& stream) { - Mutex::Autolock _l(mCore->mMutex); - mCore->mSidebandStream = stream; + sp<IConsumerListener> listener; + { // Autolock scope + Mutex::Autolock _l(mCore->mMutex); + mCore->mSidebandStream = stream; + listener = mCore->mConsumerListener; + } // Autolock scope + + if (listener != NULL) { + listener->onSidebandStreamChanged(); + } return NO_ERROR; } diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index 7f2ee2a..f272fd2 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -959,7 +959,7 @@ void Layer::onPostComposition() { bool Layer::isVisible() const { const Layer::State& s(mDrawingState); return !(s.flags & layer_state_t::eLayerHidden) && s.alpha - && (mActiveBuffer != NULL); + && (mActiveBuffer != NULL || mSidebandStream != NULL); } Region Layer::latchBuffer(bool& recomputeVisibleRegions) |