summaryrefslogtreecommitdiffstats
path: root/libs/surfaceflinger/Layer.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-09-17 19:19:08 -0700
committerMathias Agopian <mathias@google.com>2009-09-17 19:23:59 -0700
commit6d9f69843bae31b2da9a8f2869547b1ff5d0654d (patch)
treeddf9997a99de47b84c5ca2e62218cf957dd2cae9 /libs/surfaceflinger/Layer.cpp
parent84adf49fa1f5fdcb749150436295aeb5054bc2ce (diff)
downloadframeworks_native-6d9f69843bae31b2da9a8f2869547b1ff5d0654d.zip
frameworks_native-6d9f69843bae31b2da9a8f2869547b1ff5d0654d.tar.gz
frameworks_native-6d9f69843bae31b2da9a8f2869547b1ff5d0654d.tar.bz2
fix [2129080] Soft reboot after clicking around and then rubbing the screen
Diffstat (limited to 'libs/surfaceflinger/Layer.cpp')
-rw-r--r--libs/surfaceflinger/Layer.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/libs/surfaceflinger/Layer.cpp b/libs/surfaceflinger/Layer.cpp
index 7387c85..8dfc2cf 100644
--- a/libs/surfaceflinger/Layer.cpp
+++ b/libs/surfaceflinger/Layer.cpp
@@ -176,7 +176,7 @@ void Layer::reloadTexture(const Region& dirty)
// this failed, for instance, because we don't support
// NPOT.
// FIXME: do something!
- LOGD("layer=%p, glEGLImageTargetTexture2DOES(%d) "
+ LOGD("layer=%p, glEGLImageTargetTexture2DOES(%p) "
"failed err=0x%04x",
this, mTextures[index].image, error);
mFlags &= ~DisplayHardware::DIRECT_TEXTURE;
@@ -256,11 +256,17 @@ sp<SurfaceBuffer> Layer::requestBuffer(int index, int usage)
w = mWidth;
h = mHeight;
buffer = mBuffers[index];
+
+ // destroy() could have been called before we get here, we log it
+ // because it's uncommon, and the code below should handle it
+ LOGW_IF(buffer==0,
+ "mBuffers[%d] is null (mWidth=%d, mHeight=%d)",
+ index, w, h);
+
mBuffers[index].clear();
}
-
- if (buffer->getStrongCount() == 1) {
+ if (buffer!=0 && buffer->getStrongCount() == 1) {
err = buffer->reallocate(w, h, mFormat, usage, mBufferFlags);
} else {
// here we have to reallocate a new buffer because we could have a