summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-08-21 15:44:17 -0700
committerMathias Agopian <mathias@google.com>2009-08-21 15:44:17 -0700
commit04bc12bd4316e2928134037cd0f81c6d8b2adcc8 (patch)
treea4795890653d2bab4a2d63af4574a2cd8bac54fe /libs
parente0037413f2d16e1b8d1032e1791fd37621719e36 (diff)
downloadframeworks_native-04bc12bd4316e2928134037cd0f81c6d8b2adcc8.zip
frameworks_native-04bc12bd4316e2928134037cd0f81c6d8b2adcc8.tar.gz
frameworks_native-04bc12bd4316e2928134037cd0f81c6d8b2adcc8.tar.bz2
fix [2070341] [FAST BLOCKER] can't successfully setup erc52
Diffstat (limited to 'libs')
-rw-r--r--libs/ui/Surface.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/libs/ui/Surface.cpp b/libs/ui/Surface.cpp
index 36a10cf..474308a 100644
--- a/libs/ui/Surface.cpp
+++ b/libs/ui/Surface.cpp
@@ -602,7 +602,18 @@ int Surface::dequeueBuffer(android_native_buffer_t** buffer)
mBackbufferIndex = backIdx;
layer_cblk_t* const lcblk = &(cblk->layers[index]);
volatile const surface_info_t* const back = lcblk->surface + backIdx;
- if ((back->flags & surface_info_t::eNeedNewBuffer) || mUsageChanged) {
+
+ const sp<SurfaceBuffer>& backBuffer(mBuffers[backIdx]);
+
+ if (backBuffer==0 &&
+ !((back->flags & surface_info_t::eNeedNewBuffer) || mUsageChanged)) {
+ LOGW("dequeueBuffer: backbuffer is null, but eNeedNewBuffer "
+ "is not set, fetching a buffer anyways...");
+ }
+
+ if ((back->flags & surface_info_t::eNeedNewBuffer) ||mUsageChanged ||
+ backBuffer==0)
+ {
mUsageChanged = false;
err = getBufferLocked(backIdx, mUsage);
if (err == NO_ERROR) {
@@ -614,7 +625,6 @@ int Surface::dequeueBuffer(android_native_buffer_t** buffer)
}
if (err == NO_ERROR) {
- const sp<SurfaceBuffer>& backBuffer(mBuffers[backIdx]);
if (backBuffer != 0) {
mDirtyRegion.set(backBuffer->width, backBuffer->height);
*buffer = backBuffer.get();