diff options
author | Mathias Agopian <mathias@google.com> | 2013-03-12 17:11:48 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2013-03-12 17:11:48 -0700 |
commit | 4d9b822e2c18142e55fe2611aa6cd7dc7d4a62c6 (patch) | |
tree | efde8891af25d54a8211ee4280733046f4417c25 /services/surfaceflinger/Client.cpp | |
parent | f44e9f91f37d3fbed64bc952f241d5dc3c385b6a (diff) | |
download | frameworks_native-4d9b822e2c18142e55fe2611aa6cd7dc7d4a62c6.zip frameworks_native-4d9b822e2c18142e55fe2611aa6cd7dc7d4a62c6.tar.gz frameworks_native-4d9b822e2c18142e55fe2611aa6cd7dc7d4a62c6.tar.bz2 |
get rid of ISurface
ISurface was only used to get the IGraphicBufferProducer from
a Layer. It's now replaced by a BBinder subclass / IBinder and
is only used as a handle to the surface, to both refer to it
and manage its life-time.
Also cleaned-up a bit the ISurfaceComposer interface and
"create layer" code path.
Change-Id: I68d0e02d57b862cffb31d5168c3bc10cea0906eb
Diffstat (limited to 'services/surfaceflinger/Client.cpp')
-rw-r--r-- | services/surfaceflinger/Client.cpp | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/services/surfaceflinger/Client.cpp b/services/surfaceflinger/Client.cpp index 0575e35..dd65348 100644 --- a/services/surfaceflinger/Client.cpp +++ b/services/surfaceflinger/Client.cpp @@ -105,10 +105,11 @@ status_t Client::onTransact( } -sp<ISurface> Client::createSurface( +status_t Client::createSurface( const String8& name, - uint32_t w, uint32_t h, PixelFormat format, - uint32_t flags) + uint32_t w, uint32_t h, PixelFormat format, uint32_t flags, + sp<IBinder>* handle, + sp<IGraphicBufferProducer>* gbp) { /* * createSurface must be called from the GL thread so that it can @@ -116,9 +117,11 @@ sp<ISurface> Client::createSurface( */ class MessageCreateLayer : public MessageBase { - sp<ISurface> result; SurfaceFlinger* flinger; Client* client; + sp<IBinder>* handle; + sp<IGraphicBufferProducer>* gbp; + status_t result; const String8& name; uint32_t w, h; PixelFormat format; @@ -126,21 +129,23 @@ sp<ISurface> Client::createSurface( public: MessageCreateLayer(SurfaceFlinger* flinger, const String8& name, Client* client, - uint32_t w, uint32_t h, PixelFormat format, - uint32_t flags) - : flinger(flinger), client(client), name(name), - w(w), h(h), format(format), flags(flags) - { + uint32_t w, uint32_t h, PixelFormat format, uint32_t flags, + sp<IBinder>* handle, + sp<IGraphicBufferProducer>* gbp) + : flinger(flinger), client(client), + handle(handle), gbp(gbp), + name(name), w(w), h(h), format(format), flags(flags) { } - sp<ISurface> getResult() const { return result; } + status_t getResult() const { return result; } virtual bool handler() { - result = flinger->createLayer(name, client, w, h, format, flags); + result = flinger->createLayer(name, client, w, h, format, flags, + handle, gbp); return true; } }; sp<MessageBase> msg = new MessageCreateLayer(mFlinger.get(), - name, this, w, h, format, flags); + name, this, w, h, format, flags, handle, gbp); mFlinger->postMessageSync(msg); return static_cast<MessageCreateLayer*>( msg.get() )->getResult(); } |