summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-12-02 17:50:45 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2009-12-02 17:50:45 -0800
commit96dac84be4143d83b13648045b9af31ac0f81004 (patch)
tree8576e37837c03ecc455fd4ac2883b4d3b35481c9
parentf72fb68bf32014b075fe577c8495c2c8a86476a9 (diff)
parent121a31ac3901fcb81c808da2b4a9a7cf66c12b7c (diff)
downloadframeworks_base-96dac84be4143d83b13648045b9af31ac0f81004.zip
frameworks_base-96dac84be4143d83b13648045b9af31ac0f81004.tar.gz
frameworks_base-96dac84be4143d83b13648045b9af31ac0f81004.tar.bz2
am 121a31ac: Merge change Id86beb99 into eclair
Merge commit '121a31ac3901fcb81c808da2b4a9a7cf66c12b7c' into eclair-mr2 * commit '121a31ac3901fcb81c808da2b4a9a7cf66c12b7c': fix [2291418] Camera preview cannot work in Emulator
-rw-r--r--libs/surfaceflinger/LayerBuffer.cpp28
1 files changed, 15 insertions, 13 deletions
diff --git a/libs/surfaceflinger/LayerBuffer.cpp b/libs/surfaceflinger/LayerBuffer.cpp
index 88ef7e4..eb017bf 100644
--- a/libs/surfaceflinger/LayerBuffer.cpp
+++ b/libs/surfaceflinger/LayerBuffer.cpp
@@ -266,7 +266,16 @@ LayerBuffer::Buffer::Buffer(const ISurface::BufferHeap& buffers, ssize_t offset)
: mBufferHeap(buffers)
{
NativeBuffer& src(mNativeBuffer);
- src.img.handle = 0;
+ src.crop.l = 0;
+ src.crop.t = 0;
+ src.crop.r = buffers.w;
+ src.crop.b = buffers.h;
+
+ src.img.w = buffers.hor_stride ?: buffers.w;
+ src.img.h = buffers.ver_stride ?: buffers.h;
+ src.img.format = buffers.format;
+ src.img.base = (void*)(intptr_t(buffers.heap->base()) + offset);
+ src.img.handle = 0;
gralloc_module_t const * module = LayerBuffer::getGrallocModule();
if (module && module->perform) {
@@ -276,19 +285,12 @@ LayerBuffer::Buffer::Buffer(const ISurface::BufferHeap& buffers, ssize_t offset)
offset, buffers.heap->base(),
&src.img.handle);
- if (err == NO_ERROR) {
- src.crop.l = 0;
- src.crop.t = 0;
- src.crop.r = buffers.w;
- src.crop.b = buffers.h;
-
- src.img.w = buffers.hor_stride ?: buffers.w;
- src.img.h = buffers.ver_stride ?: buffers.h;
- src.img.format = buffers.format;
- src.img.base = (void*)(intptr_t(buffers.heap->base()) + offset);
- }
+ LOGE_IF(err, "CREATE_HANDLE_FROM_BUFFER (heapId=%d, size=%d, "
+ "offset=%ld, base=%p) failed (%s)",
+ buffers.heap->heapID(), buffers.heap->getSize(),
+ offset, buffers.heap->base(), strerror(-err));
}
-}
+ }
LayerBuffer::Buffer::~Buffer()
{