summaryrefslogtreecommitdiff
path: root/libs/ui/ISurface.cpp
diff options
context:
space:
mode:
author Mathias Agopian <mathias@google.com> 2009-08-11 22:34:02 -0700
committer Mathias Agopian <mathias@google.com> 2009-08-11 23:32:29 -0700
commit5cec4742b3a1d7448bd32ae57cb4cf70b484c64c (patch)
tree9a3d6adb933fd0947ffc643e3d11f432a4baec4b /libs/ui/ISurface.cpp
parent064dbd076d431a7508b864aa0993cd59ef743e4e (diff)
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."
Diffstat (limited to 'libs/ui/ISurface.cpp')
-rw-r--r--libs/ui/ISurface.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/ui/ISurface.cpp b/libs/ui/ISurface.cpp
index 9fbae1ebafe1..b78e8b5ab5a1 100644
--- a/libs/ui/ISurface.cpp
+++ b/libs/ui/ISurface.cpp
@@ -71,10 +71,11 @@ public:
{
}
- virtual sp<SurfaceBuffer> getBuffer()
+ virtual sp<SurfaceBuffer> getBuffer(int usage)
{
Parcel data, reply;
data.writeInterfaceToken(ISurface::getInterfaceDescriptor());
+ data.writeInt32(usage);
remote()->transact(GET_BUFFER, data, &reply);
sp<SurfaceBuffer> buffer = new SurfaceBuffer(reply);
return buffer;
@@ -135,7 +136,8 @@ status_t BnSurface::onTransact(
switch(code) {
case GET_BUFFER: {
CHECK_INTERFACE(ISurface, data, reply);
- sp<SurfaceBuffer> buffer(getBuffer());
+ int usage = data.readInt32();
+ sp<SurfaceBuffer> buffer(getBuffer(usage));
return SurfaceBuffer::writeToParcel(reply, buffer.get());
}
case REGISTER_BUFFERS: {