diff options
| author | 2011-04-20 14:20:59 -0700 | |
|---|---|---|
| committer | 2011-06-13 15:51:35 -0700 | |
| commit | a67932fe6864ac346e7f78b86df11cf6c5344137 (patch) | |
| tree | c7a9d1e48498b0683666c32d005fad728dd3475e /libs/gui/ISurfaceComposerClient.cpp | |
| parent | ac642349ba89c8839c421502fb779bee5cebfee3 (diff) | |
unify SurfaceTexture and Surface
Add the concept of synchronous dequeueBuffer in SurfaceTexture
Implement {Surface|SurfaceTextureClient}::setSwapInterval()
Add SurfaceTexture logging
fix onFrameAvailable
Diffstat (limited to 'libs/gui/ISurfaceComposerClient.cpp')
| -rw-r--r-- | libs/gui/ISurfaceComposerClient.cpp | 56 |
1 files changed, 1 insertions, 55 deletions
diff --git a/libs/gui/ISurfaceComposerClient.cpp b/libs/gui/ISurfaceComposerClient.cpp index ea38e08a55..8d83392588 100644 --- a/libs/gui/ISurfaceComposerClient.cpp +++ b/libs/gui/ISurfaceComposerClient.cpp @@ -50,9 +50,7 @@ namespace android { enum { - GET_CBLK = IBinder::FIRST_CALL_TRANSACTION, - GET_TOKEN, - CREATE_SURFACE, + CREATE_SURFACE = IBinder::FIRST_CALL_TRANSACTION, DESTROY_SURFACE, SET_STATE }; @@ -65,23 +63,6 @@ public: { } - virtual sp<IMemoryHeap> getControlBlock() const - { - Parcel data, reply; - data.writeInterfaceToken(ISurfaceComposerClient::getInterfaceDescriptor()); - remote()->transact(GET_CBLK, data, &reply); - return interface_cast<IMemoryHeap>(reply.readStrongBinder()); - } - - virtual ssize_t getTokenForSurface(const sp<ISurface>& sur) const - { - Parcel data, reply; - data.writeInterfaceToken(ISurfaceComposerClient::getInterfaceDescriptor()); - data.writeStrongBinder(sur->asBinder()); - remote()->transact(GET_TOKEN, data, &reply); - return reply.readInt32(); - } - virtual sp<ISurface> createSurface( surface_data_t* params, const String8& name, DisplayID display, @@ -131,41 +112,6 @@ IMPLEMENT_META_INTERFACE(SurfaceComposerClient, "android.ui.ISurfaceComposerClie status_t BnSurfaceComposerClient::onTransact( uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags) { - // codes that don't require permission check - - switch(code) { - case GET_CBLK: { - CHECK_INTERFACE(ISurfaceComposerClient, data, reply); - sp<IMemoryHeap> ctl(getControlBlock()); - reply->writeStrongBinder(ctl->asBinder()); - return NO_ERROR; - } break; - case GET_TOKEN: { - CHECK_INTERFACE(ISurfaceComposerClient, data, reply); - sp<ISurface> sur = interface_cast<ISurface>(data.readStrongBinder()); - ssize_t token = getTokenForSurface(sur); - reply->writeInt32(token); - return NO_ERROR; - } break; - } - - // these must be checked - - IPCThreadState* ipc = IPCThreadState::self(); - const int pid = ipc->getCallingPid(); - const int uid = ipc->getCallingUid(); - const int self_pid = getpid(); - if (UNLIKELY(pid != self_pid && uid != AID_GRAPHICS && uid != 0)) { - // we're called from a different process, do the real check - if (!checkCallingPermission( - String16("android.permission.ACCESS_SURFACE_FLINGER"))) - { - LOGE("Permission Denial: " - "can't openGlobalTransaction pid=%d, uid=%d", pid, uid); - return PERMISSION_DENIED; - } - } - switch(code) { case CREATE_SURFACE: { CHECK_INTERFACE(ISurfaceComposerClient, data, reply); |