diff options
author | 2009-07-06 14:52:04 -0700 | |
---|---|---|
committer | 2009-07-06 14:52:04 -0700 | |
commit | d8b2a6412daef032d89c23e979758f6334b62093 (patch) | |
tree | dba55e2701d88e7bb380604520a230abb16b4b66 /libs/ui/ISurface.cpp | |
parent | d719890cab1eec09cbf556a3b86cc02b0f0ef8d7 (diff) | |
parent | 03a9a3449af3e0e79e9bbcd87f8057189ab9e151 (diff) |
Merge commit 'goog/master_gl' into merge_master_gl
Diffstat (limited to 'libs/ui/ISurface.cpp')
-rw-r--r-- | libs/ui/ISurface.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libs/ui/ISurface.cpp b/libs/ui/ISurface.cpp index 1e60557827d1..9fbae1ebafe1 100644 --- a/libs/ui/ISurface.cpp +++ b/libs/ui/ISurface.cpp @@ -14,6 +14,8 @@ * limitations under the License. */ +#define LOG_TAG "ISurface" + #include <stdio.h> #include <stdint.h> #include <sys/types.h> @@ -23,10 +25,14 @@ #include <ui/ISurface.h> #include <ui/Overlay.h> +#include <ui/Surface.h> +#include <private/ui/SurfaceBuffer.h> namespace android { +// ---------------------------------------------------------------------- + ISurface::BufferHeap::BufferHeap() : w(0), h(0), hor_stride(0), ver_stride(0), format(0), transform(0), flags(0) @@ -55,6 +61,8 @@ ISurface::BufferHeap::~BufferHeap() { } +// ---------------------------------------------------------------------- + class BpSurface : public BpInterface<ISurface> { public: @@ -63,6 +71,15 @@ public: { } + virtual sp<SurfaceBuffer> getBuffer() + { + Parcel data, reply; + data.writeInterfaceToken(ISurface::getInterfaceDescriptor()); + remote()->transact(GET_BUFFER, data, &reply); + sp<SurfaceBuffer> buffer = new SurfaceBuffer(reply); + return buffer; + } + virtual status_t registerBuffers(const BufferHeap& buffers) { Parcel data, reply; @@ -116,6 +133,11 @@ status_t BnSurface::onTransact( uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags) { switch(code) { + case GET_BUFFER: { + CHECK_INTERFACE(ISurface, data, reply); + sp<SurfaceBuffer> buffer(getBuffer()); + return SurfaceBuffer::writeToParcel(reply, buffer.get()); + } case REGISTER_BUFFERS: { CHECK_INTERFACE(ISurface, data, reply); BufferHeap buffer; |