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
diff --git a/include/gui/SurfaceControl.h b/include/gui/SurfaceControl.h
index f70888d..fe8eb6f 100644
--- a/include/gui/SurfaceControl.h
+++ b/include/gui/SurfaceControl.h
@@ -27,7 +27,6 @@
#include <ui/PixelFormat.h>
#include <ui/Region.h>
-#include <gui/ISurface.h>
#include <gui/ISurfaceComposerClient.h>
namespace android {
@@ -46,9 +45,11 @@
static bool isValid(const sp<SurfaceControl>& surface) {
return (surface != 0) && surface->isValid();
}
+
bool isValid() {
- return mSurface!=0 && mClient!=0;
+ return mHandle!=0 && mClient!=0;
}
+
static bool isSameSurface(
const sp<SurfaceControl>& lhs, const sp<SurfaceControl>& rhs);
@@ -82,7 +83,8 @@
SurfaceControl(
const sp<SurfaceComposerClient>& client,
- const sp<ISurface>& surface);
+ const sp<IBinder>& handle,
+ const sp<IGraphicBufferProducer>& gbp);
~SurfaceControl();
@@ -90,7 +92,7 @@
void destroy();
sp<SurfaceComposerClient> mClient;
- sp<IBinder> mSurface;
+ sp<IBinder> mHandle;
sp<IGraphicBufferProducer> mGraphicBufferProducer;
mutable Mutex mLock;
mutable sp<Surface> mSurfaceData;