diff options
Diffstat (limited to 'libs/gui/IGraphicBufferAlloc.cpp')
-rw-r--r-- | libs/gui/IGraphicBufferAlloc.cpp | 44 |
1 files changed, 19 insertions, 25 deletions
diff --git a/libs/gui/IGraphicBufferAlloc.cpp b/libs/gui/IGraphicBufferAlloc.cpp index 09b63a1..139f219 100644 --- a/libs/gui/IGraphicBufferAlloc.cpp +++ b/libs/gui/IGraphicBufferAlloc.cpp @@ -42,17 +42,14 @@ public: { } - virtual ~BpGraphicBufferAlloc(); - - virtual sp<GraphicBuffer> createGraphicBuffer(uint32_t width, - uint32_t height, PixelFormat format, uint32_t usage, - status_t* error) { + virtual sp<GraphicBuffer> createGraphicBuffer(uint32_t w, uint32_t h, + PixelFormat format, uint32_t usage, status_t* error) { Parcel data, reply; data.writeInterfaceToken(IGraphicBufferAlloc::getInterfaceDescriptor()); - data.writeUint32(width); - data.writeUint32(height); - data.writeInt32(static_cast<int32_t>(format)); - data.writeUint32(usage); + data.writeInt32(w); + data.writeInt32(h); + data.writeInt32(format); + data.writeInt32(usage); remote()->transact(CREATE_GRAPHIC_BUFFER, data, &reply); sp<GraphicBuffer> graphicBuffer; status_t result = reply.readInt32(); @@ -68,10 +65,6 @@ public: } }; -// Out-of-line virtual method definition to trigger vtable emission in this -// translation unit (see clang warning -Wweak-vtables) -BpGraphicBufferAlloc::~BpGraphicBufferAlloc() {} - IMPLEMENT_META_INTERFACE(GraphicBufferAlloc, "android.ui.IGraphicBufferAlloc"); // ---------------------------------------------------------------------- @@ -81,26 +74,27 @@ status_t BnGraphicBufferAlloc::onTransact( { // codes that don't require permission check - // BufferReference just keeps a strong reference to a GraphicBuffer until it - // is destroyed (that is, until no local or remote process have a reference - // to it). + /* BufferReference just keeps a strong reference to a + * GraphicBuffer until it is destroyed (that is, until + * no local or remote process have a reference to it). + */ class BufferReference : public BBinder { - sp<GraphicBuffer> mBuffer; + sp<GraphicBuffer> buffer; public: - BufferReference(const sp<GraphicBuffer>& buffer) : mBuffer(buffer) {} + BufferReference(const sp<GraphicBuffer>& buffer) : buffer(buffer) { } }; - switch (code) { + switch(code) { case CREATE_GRAPHIC_BUFFER: { CHECK_INTERFACE(IGraphicBufferAlloc, data, reply); - uint32_t width = data.readUint32(); - uint32_t height = data.readUint32(); - PixelFormat format = static_cast<PixelFormat>(data.readInt32()); - uint32_t usage = data.readUint32(); + uint32_t w = data.readInt32(); + uint32_t h = data.readInt32(); + PixelFormat format = data.readInt32(); + uint32_t usage = data.readInt32(); status_t error; sp<GraphicBuffer> result = - createGraphicBuffer(width, height, format, usage, &error); + createGraphicBuffer(w, h, format, usage, &error); reply->writeInt32(error); if (result != 0) { reply->write(*result); @@ -113,7 +107,7 @@ status_t BnGraphicBufferAlloc::onTransact( reply->writeStrongBinder( new BufferReference(result) ); } return NO_ERROR; - } + } break; default: return BBinder::onTransact(code, data, reply, flags); } |