diff options
author | Jamie Gennis <jgennis@google.com> | 2011-08-17 18:19:00 -0700 |
---|---|---|
committer | Jamie Gennis <jgennis@google.com> | 2011-08-17 18:19:00 -0700 |
commit | 9b8fc65b0353db3a962ab52dc556c356d556fcc1 (patch) | |
tree | c62f12d000864f496c9ab42ff5752a376ee7c3ae /libs/gui/ISurfaceComposer.cpp | |
parent | 842d9de74f9eaaf8a7b89dbe8475faf014ddafb8 (diff) | |
download | frameworks_base-9b8fc65b0353db3a962ab52dc556c356d556fcc1.zip frameworks_base-9b8fc65b0353db3a962ab52dc556c356d556fcc1.tar.gz frameworks_base-9b8fc65b0353db3a962ab52dc556c356d556fcc1.tar.bz2 |
SurfaceTexture: fix queues-to-composer
This change fixes the NATIVE_WINDOW_QUEUES_TO_WINDOW_COMPOSER query of
Surface and SurfaceTextureClient. Surface now uses the inherited
SurfaceTextureClient implementation of this query. SurfaceTextureClient
now queries SurfaceFlinger to determine whether buffers that are queued
to its ISurfaceTexture will be sent to SurfaceFlinger (as opposed to
some other process).
Change-Id: Iff187e72f30d454229f07f896b438198978270a8
Diffstat (limited to 'libs/gui/ISurfaceComposer.cpp')
-rw-r--r-- | libs/gui/ISurfaceComposer.cpp | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/libs/gui/ISurfaceComposer.cpp b/libs/gui/ISurfaceComposer.cpp index c1156d5..030a83e 100644 --- a/libs/gui/ISurfaceComposer.cpp +++ b/libs/gui/ISurfaceComposer.cpp @@ -31,6 +31,8 @@ #include <ui/DisplayInfo.h> +#include <gui/ISurfaceTexture.h> + #include <utils/Log.h> // --------------------------------------------------------------------------- @@ -166,35 +168,36 @@ public: return reply.readInt32(); } - virtual bool authenticateSurface(const sp<ISurface>& surface) const + virtual bool authenticateSurfaceTexture( + const sp<ISurfaceTexture>& surfaceTexture) const { Parcel data, reply; int err = NO_ERROR; err = data.writeInterfaceToken( ISurfaceComposer::getInterfaceDescriptor()); if (err != NO_ERROR) { - LOGE("ISurfaceComposer::authenticateSurface: error writing " + LOGE("ISurfaceComposer::authenticateSurfaceTexture: error writing " "interface descriptor: %s (%d)", strerror(-err), -err); return false; } - err = data.writeStrongBinder(surface->asBinder()); + err = data.writeStrongBinder(surfaceTexture->asBinder()); if (err != NO_ERROR) { - LOGE("ISurfaceComposer::authenticateSurface: error writing strong " - "binder to parcel: %s (%d)", strerror(-err), -err); + LOGE("ISurfaceComposer::authenticateSurfaceTexture: error writing " + "strong binder to parcel: %s (%d)", strerror(-err), -err); return false; } err = remote()->transact(BnSurfaceComposer::AUTHENTICATE_SURFACE, data, &reply); if (err != NO_ERROR) { - LOGE("ISurfaceComposer::authenticateSurface: error performing " - "transaction: %s (%d)", strerror(-err), -err); + LOGE("ISurfaceComposer::authenticateSurfaceTexture: error " + "performing transaction: %s (%d)", strerror(-err), -err); return false; } int32_t result = 0; err = reply.readInt32(&result); if (err != NO_ERROR) { - LOGE("ISurfaceComposer::authenticateSurface: error retrieving " - "result: %s (%d)", strerror(-err), -err); + LOGE("ISurfaceComposer::authenticateSurfaceTexture: error " + "retrieving result: %s (%d)", strerror(-err), -err); return false; } return result != 0; @@ -291,8 +294,9 @@ status_t BnSurfaceComposer::onTransact( } break; case AUTHENTICATE_SURFACE: { CHECK_INTERFACE(ISurfaceComposer, data, reply); - sp<ISurface> surface = interface_cast<ISurface>(data.readStrongBinder()); - int32_t result = authenticateSurface(surface) ? 1 : 0; + sp<ISurfaceTexture> surfaceTexture = + interface_cast<ISurfaceTexture>(data.readStrongBinder()); + int32_t result = authenticateSurfaceTexture(surfaceTexture) ? 1 : 0; reply->writeInt32(result); } break; default: |