summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/Layer.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-03-17 00:12:01 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-03-17 00:12:01 -0700
commite22aa62362a3007ee59ac62d4b5969e216987995 (patch)
tree5b5d8eca576554708d9263318d93ec1b673487c9 /services/surfaceflinger/Layer.cpp
parenta13640b9efe1706ad0b6b608ccfca800166d7c01 (diff)
parent25594e1984125081878d2ea057700366a34a8ccf (diff)
downloadframeworks_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
Diffstat (limited to 'services/surfaceflinger/Layer.cpp')
-rw-r--r--services/surfaceflinger/Layer.cpp12
1 files changed, 7 insertions, 5 deletions
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++) {