removed the "bits" attribute from android_native_buffer_t.
"bits" can never be trusted now that we need to call lock() on the handle to get the virtual address of the buffer.
diff --git a/libs/surfaceflinger/LayerBitmap.cpp b/libs/surfaceflinger/LayerBitmap.cpp
index 38d4bcf..765d90b 100644
--- a/libs/surfaceflinger/LayerBitmap.cpp
+++ b/libs/surfaceflinger/LayerBitmap.cpp
@@ -116,7 +116,8 @@
status_t Buffer::lock(GGLSurface* sur, uint32_t usage)
{
- status_t res = SurfaceBuffer::lock(usage);
+ void* vaddr;
+ status_t res = SurfaceBuffer::lock(usage, &vaddr);
if (res == NO_ERROR && sur) {
sur->version = sizeof(GGLSurface);
sur->width = width;
@@ -124,7 +125,7 @@
sur->stride = stride;
sur->format = format;
sur->vstride = mVStride;
- sur->data = static_cast<GGLubyte*>(bits);
+ sur->data = static_cast<GGLubyte*>(vaddr);
}
return res;
}