summaryrefslogtreecommitdiff
path: root/libs/gui/SurfaceComposerClient.cpp
diff options
context:
space:
mode:
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
commit4d9b822e2c18142e55fe2611aa6cd7dc7d4a62c6 (patch)
treeefde8891af25d54a8211ee4280733046f4417c25 /libs/gui/SurfaceComposerClient.cpp
parentf44e9f91f37d3fbed64bc952f241d5dc3c385b6a (diff)
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 'libs/gui/SurfaceComposerClient.cpp')
-rw-r--r--libs/gui/SurfaceComposerClient.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index edfa78a35f..4a4c0c8df4 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -32,7 +32,6 @@
#include <ui/DisplayInfo.h>
#include <gui/IGraphicBufferProducer.h>
-#include <gui/ISurface.h>
#include <gui/ISurfaceComposer.h>
#include <gui/ISurfaceComposerClient.h>
#include <gui/SurfaceComposerClient.h>
@@ -471,14 +470,18 @@ sp<SurfaceControl> SurfaceComposerClient::createSurface(
PixelFormat format,
uint32_t flags)
{
- sp<SurfaceControl> result;
+ sp<SurfaceControl> sur;
if (mStatus == NO_ERROR) {
- sp<ISurface> surface = mClient->createSurface(name, w, h, format, flags);
- if (surface != 0) {
- result = new SurfaceControl(this, surface);
+ sp<IBinder> handle;
+ sp<IGraphicBufferProducer> gbp;
+ status_t err = mClient->createSurface(name, w, h, format, flags,
+ &handle, &gbp);
+ ALOGE_IF(err, "SurfaceComposerClient::createSurface error %s", strerror(-err));
+ if (err == NO_ERROR) {
+ sur = new SurfaceControl(this, handle, gbp);
}
}
- return result;
+ return sur;
}
sp<IBinder> SurfaceComposerClient::createDisplay(const String8& displayName,