diff options
author | Mathias Agopian <mathias@google.com> | 2011-03-17 00:12:01 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-03-17 00:12:01 -0700 |
commit | e22aa62362a3007ee59ac62d4b5969e216987995 (patch) | |
tree | 5b5d8eca576554708d9263318d93ec1b673487c9 | |
parent | a13640b9efe1706ad0b6b608ccfca800166d7c01 (diff) | |
parent | 25594e1984125081878d2ea057700366a34a8ccf (diff) | |
download | frameworks_base-e22aa62362a3007ee59ac62d4b5969e216987995.zip frameworks_base-e22aa62362a3007ee59ac62d4b5969e216987995.tar.gz frameworks_base-e22aa62362a3007ee59ac62d4b5969e216987995.tar.bz2 |
am 25594e19: am f40e638e: fix [4093196] Device lock up - log spam with SharedBufferStack: waitForCondition(LockCondition) timed out
* commit '25594e1984125081878d2ea057700366a34a8ccf':
fix [4093196] Device lock up - log spam with SharedBufferStack: waitForCondition(LockCondition) timed out
-rw-r--r-- | include/utils/Vector.h | 3 | ||||
-rw-r--r-- | libs/ui/Region.cpp | 12 | ||||
-rw-r--r-- | services/surfaceflinger/Layer.cpp | 12 |
3 files changed, 21 insertions, 6 deletions
diff --git a/include/utils/Vector.h b/include/utils/Vector.h index ec851bd..6fd307f 100644 --- a/include/utils/Vector.h +++ b/include/utils/Vector.h @@ -162,6 +162,9 @@ public: inline status_t sort(compar_t cmp); inline status_t sort(compar_r_t cmp, void* state); + // for debugging only + inline size_t getItemSize() const { return itemSize(); } + protected: virtual void do_construct(void* storage, size_t num) const; virtual void do_destroy(void* storage, size_t num) const; diff --git a/libs/ui/Region.cpp b/libs/ui/Region.cpp index 1994f6a..a060a5f 100644 --- a/libs/ui/Region.cpp +++ b/libs/ui/Region.cpp @@ -56,6 +56,9 @@ Region::Region() Region::Region(const Region& rhs) : mBounds(rhs.mBounds), mStorage(rhs.mStorage) { +#if VALIDATE_REGIONS + validate(rhs, "rhs copy-ctor"); +#endif } Region::Region(const Rect& rhs) @@ -76,7 +79,8 @@ Region::~Region() Region& Region::operator = (const Region& rhs) { #if VALIDATE_REGIONS - validate(rhs, "operator="); + validate(*this, "this->operator="); + validate(rhs, "rhs.operator="); #endif mBounds = rhs.mBounds; mStorage = rhs.mStorage; @@ -366,6 +370,12 @@ void Region::boolean_operation(int op, Region& dst, const Region& lhs, const Region& rhs, int dx, int dy) { +#if VALIDATE_REGIONS + validate(lhs, "boolean_operation (before): lhs"); + validate(rhs, "boolean_operation (before): rhs"); + validate(dst, "boolean_operation (before): dst"); +#endif + size_t lhs_count; Rect const * const lhs_rects = lhs.getArray(&lhs_count); diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index 1297363..cd24478 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -858,11 +858,13 @@ status_t Layer::BufferManager::resize(size_t size, Mutex::Autolock _l(mLock); if (size < mNumBuffers) { - // Move the active texture into slot 0 - BufferData activeBufferData = mBufferData[mActiveBufferIndex]; - mBufferData[mActiveBufferIndex] = mBufferData[0]; - mBufferData[0] = activeBufferData; - mActiveBufferIndex = 0; + // If there is an active texture, move it into slot 0 if needed + if (mActiveBufferIndex > 0) { + BufferData activeBufferData = mBufferData[mActiveBufferIndex]; + mBufferData[mActiveBufferIndex] = mBufferData[0]; + mBufferData[0] = activeBufferData; + mActiveBufferIndex = 0; + } // Free the buffers that are no longer needed. for (size_t i = size; i < mNumBuffers; i++) { |