get rid of Surface identity and token
we use the IBinder instead.
Change-Id: I4aa0b58869ba43f19980013620051e5a261b062d
diff --git a/include/gui/ISurface.h b/include/gui/ISurface.h
index ce6e715..5a928f2 100644
--- a/include/gui/ISurface.h
+++ b/include/gui/ISurface.h
@@ -29,8 +29,6 @@
namespace android {
-typedef int32_t SurfaceID;
-
class IGraphicBufferProducer;
class ISurface : public IInterface
diff --git a/include/gui/ISurfaceComposerClient.h b/include/gui/ISurfaceComposerClient.h
index e256e33..23d1d4c 100644
--- a/include/gui/ISurfaceComposerClient.h
+++ b/include/gui/ISurfaceComposerClient.h
@@ -54,24 +54,17 @@
eFXSurfaceMask = 0x000F0000,
};
- struct surface_data_t {
- int32_t token;
- int32_t identity;
- status_t readFromParcel(const Parcel& parcel);
- status_t writeToParcel(Parcel* parcel) const;
- };
-
/*
* Requires ACCESS_SURFACE_FLINGER permission
*/
- virtual sp<ISurface> createSurface(surface_data_t* data,
+ virtual sp<ISurface> createSurface(
const String8& name, uint32_t w, uint32_t h,
PixelFormat format, uint32_t flags) = 0;
/*
* Requires ACCESS_SURFACE_FLINGER permission
*/
- virtual status_t destroySurface(SurfaceID sid) = 0;
+ virtual status_t destroySurface(const sp<IBinder>& handle) = 0;
};
// ----------------------------------------------------------------------------
diff --git a/include/gui/Surface.h b/include/gui/Surface.h
index 8654f76..27921df 100644
--- a/include/gui/Surface.h
+++ b/include/gui/Surface.h
@@ -50,13 +50,11 @@
return (surface != 0) && surface->isValid();
}
bool isValid() {
- return mToken>=0 && mClient!=0;
+ return mSurface!=0 && mClient!=0;
}
static bool isSameSurface(
const sp<SurfaceControl>& lhs, const sp<SurfaceControl>& rhs);
- uint32_t getIdentity() const { return mIdentity; }
-
// release surface data from java
void clear();
@@ -87,8 +85,7 @@
SurfaceControl(
const sp<SurfaceComposerClient>& client,
- const sp<ISurface>& surface,
- const ISurfaceComposerClient::surface_data_t& data);
+ const sp<ISurface>& surface);
~SurfaceControl();
@@ -96,11 +93,8 @@
void destroy();
sp<SurfaceComposerClient> mClient;
- sp<ISurface> mSurface;
- SurfaceID mToken;
- uint32_t mIdentity;
+ sp<IBinder> mSurface;
mutable Mutex mLock;
-
mutable sp<Surface> mSurfaceData;
};
diff --git a/include/gui/SurfaceComposerClient.h b/include/gui/SurfaceComposerClient.h
index 22e6b14..dbdd3a9 100644
--- a/include/gui/SurfaceComposerClient.h
+++ b/include/gui/SurfaceComposerClient.h
@@ -108,18 +108,18 @@
//! Flag the currently open transaction as an animation transaction.
static void setAnimationTransaction();
- status_t hide(SurfaceID id);
- status_t show(SurfaceID id);
- status_t setFlags(SurfaceID id, uint32_t flags, uint32_t mask);
- status_t setTransparentRegionHint(SurfaceID id, const Region& transparent);
- status_t setLayer(SurfaceID id, int32_t layer);
- status_t setAlpha(SurfaceID id, float alpha=1.0f);
- status_t setMatrix(SurfaceID id, float dsdx, float dtdx, float dsdy, float dtdy);
- status_t setPosition(SurfaceID id, float x, float y);
- status_t setSize(SurfaceID id, uint32_t w, uint32_t h);
- status_t setCrop(SurfaceID id, const Rect& crop);
- status_t setLayerStack(SurfaceID id, uint32_t layerStack);
- status_t destroySurface(SurfaceID sid);
+ status_t hide(const sp<IBinder>& id);
+ status_t show(const sp<IBinder>& id);
+ status_t setFlags(const sp<IBinder>& id, uint32_t flags, uint32_t mask);
+ status_t setTransparentRegionHint(const sp<IBinder>& id, const Region& transparent);
+ status_t setLayer(const sp<IBinder>& id, int32_t layer);
+ status_t setAlpha(const sp<IBinder>& id, float alpha=1.0f);
+ status_t setMatrix(const sp<IBinder>& id, float dsdx, float dtdx, float dsdy, float dtdy);
+ status_t setPosition(const sp<IBinder>& id, float x, float y);
+ status_t setSize(const sp<IBinder>& id, uint32_t w, uint32_t h);
+ status_t setCrop(const sp<IBinder>& id, const Rect& crop);
+ status_t setLayerStack(const sp<IBinder>& id, uint32_t layerStack);
+ status_t destroySurface(const sp<IBinder>& id);
static void setDisplaySurface(const sp<IBinder>& token,
const sp<IGraphicBufferProducer>& bufferProducer);