second take, hopefully this time it doesn't break one of the builds: "SurfaceFlinger will now allocate buffers based on the usage specified by the clients. This allows to allocate the right kind of buffer automatically, without having the user to specify anything."
diff --git a/libs/surfaceflinger/LayerBitmap.h b/libs/surfaceflinger/LayerBitmap.h
index 22525ce..48ee553 100644
--- a/libs/surfaceflinger/LayerBitmap.h
+++ b/libs/surfaceflinger/LayerBitmap.h
@@ -58,7 +58,8 @@
};
// creates w * h buffer
- Buffer(uint32_t w, uint32_t h, PixelFormat format, uint32_t flags = 0);
+ Buffer(uint32_t w, uint32_t h, PixelFormat format,
+ uint32_t reqUsage, uint32_t flags = 0);
// return status
status_t initCheck() const;
@@ -81,7 +82,7 @@
Buffer& operator = (const Buffer& rhs);
const Buffer& operator = (const Buffer& rhs) const;
- status_t initSize(uint32_t w, uint32_t h);
+ status_t initSize(uint32_t w, uint32_t h, uint32_t reqUsage);
ssize_t mInitCheck;
uint32_t mFlags;
@@ -108,7 +109,7 @@
status_t setSize(uint32_t w, uint32_t h);
- sp<Buffer> allocate();
+ sp<Buffer> allocate(uint32_t reqUsage);
status_t free();
sp<const Buffer> getBuffer() const { return mBuffer; }