Loading include/private/surfaceflinger/SharedBufferStack.h +5 −4 Original line number Diff line number Diff line Loading @@ -295,7 +295,8 @@ private: friend class BufferList; uint32_t mask, curr; const_iterator(uint32_t mask) : mask(mask), curr(31 - __builtin_clz(mask)) { } mask(mask), curr(__builtin_clz(mask)) { } public: inline bool operator == (const const_iterator& rhs) const { return mask == rhs.mask; Loading @@ -304,9 +305,9 @@ private: return mask != rhs.mask; } inline int operator *() const { return curr; } inline const const_iterator& operator ++(int) { mask &= ~curr; curr = 31 - __builtin_clz(mask); inline const const_iterator& operator ++() { mask &= ~(1<<(31-curr)); curr = __builtin_clz(mask); return *this; } }; Loading libs/surfaceflinger_client/SharedBufferStack.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -560,6 +560,7 @@ status_t SharedBufferServer::resize(int newNumBuffers) int base = numBuffers; int32_t avail = stack.available; int tail = head - avail + 1; if (tail >= 0) { int8_t* const index = const_cast<int8_t*>(stack.index); const int nb = numBuffers - head; Loading @@ -573,8 +574,9 @@ status_t SharedBufferServer::resize(int newNumBuffers) // fill the new free space with unused buffers BufferList::const_iterator curr(mBufferList.free_begin()); for (int i=0 ; i<extra ; i++) { stack.index[base+i] = *curr++; mBufferList.add(stack.index[base+i]); stack.index[base+i] = *curr; mBufferList.add(*curr); ++curr; } mNumBuffers = newNumBuffers; Loading Loading
include/private/surfaceflinger/SharedBufferStack.h +5 −4 Original line number Diff line number Diff line Loading @@ -295,7 +295,8 @@ private: friend class BufferList; uint32_t mask, curr; const_iterator(uint32_t mask) : mask(mask), curr(31 - __builtin_clz(mask)) { } mask(mask), curr(__builtin_clz(mask)) { } public: inline bool operator == (const const_iterator& rhs) const { return mask == rhs.mask; Loading @@ -304,9 +305,9 @@ private: return mask != rhs.mask; } inline int operator *() const { return curr; } inline const const_iterator& operator ++(int) { mask &= ~curr; curr = 31 - __builtin_clz(mask); inline const const_iterator& operator ++() { mask &= ~(1<<(31-curr)); curr = __builtin_clz(mask); return *this; } }; Loading
libs/surfaceflinger_client/SharedBufferStack.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -560,6 +560,7 @@ status_t SharedBufferServer::resize(int newNumBuffers) int base = numBuffers; int32_t avail = stack.available; int tail = head - avail + 1; if (tail >= 0) { int8_t* const index = const_cast<int8_t*>(stack.index); const int nb = numBuffers - head; Loading @@ -573,8 +574,9 @@ status_t SharedBufferServer::resize(int newNumBuffers) // fill the new free space with unused buffers BufferList::const_iterator curr(mBufferList.free_begin()); for (int i=0 ; i<extra ; i++) { stack.index[base+i] = *curr++; mBufferList.add(stack.index[base+i]); stack.index[base+i] = *curr; mBufferList.add(*curr); ++curr; } mNumBuffers = newNumBuffers; Loading