diff options
author | Mathias Agopian <mathias@google.com> | 2010-05-21 14:51:33 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2010-05-24 13:47:24 -0700 |
commit | a0b3f1d2eb796eb90a7576c13890ab8df8516d9d (patch) | |
tree | ac808429f47a3cdb8e0ff288ff6d085a28d80284 | |
parent | 5ed37d33432bb8dbadb22eb7a6481b97b28f548c (diff) | |
download | frameworks_native-a0b3f1d2eb796eb90a7576c13890ab8df8516d9d.zip frameworks_native-a0b3f1d2eb796eb90a7576c13890ab8df8516d9d.tar.gz frameworks_native-a0b3f1d2eb796eb90a7576c13890ab8df8516d9d.tar.bz2 |
fix a bug when reallocating a window's buffers is needed
we need to mark the buffers that need to be reallocated,
NOT the buffer's indices.
Change-Id: I809e2e1b03b56c4d2ab983c25523dae99aa1da74
-rw-r--r-- | include/private/surfaceflinger/SharedBufferStack.h | 1 | ||||
-rw-r--r-- | libs/surfaceflinger_client/SharedBufferStack.cpp | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/include/private/surfaceflinger/SharedBufferStack.h b/include/private/surfaceflinger/SharedBufferStack.h index c3ac317..de54870 100644 --- a/include/private/surfaceflinger/SharedBufferStack.h +++ b/include/private/surfaceflinger/SharedBufferStack.h @@ -303,6 +303,7 @@ private: : mCapacity(c), mList(0) { } status_t add(int value); status_t remove(int value); + uint32_t getMask() const { return mList; } class const_iterator { friend class BufferList; diff --git a/libs/surfaceflinger_client/SharedBufferStack.cpp b/libs/surfaceflinger_client/SharedBufferStack.cpp index e2e1591..8681b59 100644 --- a/libs/surfaceflinger_client/SharedBufferStack.cpp +++ b/libs/surfaceflinger_client/SharedBufferStack.cpp @@ -440,7 +440,7 @@ status_t SharedBufferClient::queue(int buf) bool SharedBufferClient::needNewBuffer(int buf) const { SharedBufferStack& stack( *mSharedStack ); - const uint32_t mask = 1<<buf; + const uint32_t mask = 1<<(31-buf); return (android_atomic_and(~mask, &stack.reallocMask) & mask) != 0; } @@ -532,7 +532,7 @@ status_t SharedBufferServer::reallocate() RWLock::AutoRLock _l(mLock); SharedBufferStack& stack( *mSharedStack ); - uint32_t mask = (1<<mNumBuffers)-1; + uint32_t mask = mBufferList.getMask(); android_atomic_or(mask, &stack.reallocMask); return NO_ERROR; } |