summaryrefslogtreecommitdiffstats
path: root/libs/surfaceflinger/LayerBase.h
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-04-17 19:36:26 -0700
committerMathias Agopian <mathias@google.com>2009-04-24 15:00:41 -0700
commit9a11206fe793363c0e8897b478cbe6ef8c52b543 (patch)
tree0b7fc29027a6803e1ab992f47f0dd66c2a3e3843 /libs/surfaceflinger/LayerBase.h
parent9f88afb013a7560bf1362d7999a4609e38d0ea77 (diff)
downloadframeworks_native-9a11206fe793363c0e8897b478cbe6ef8c52b543.zip
frameworks_native-9a11206fe793363c0e8897b478cbe6ef8c52b543.tar.gz
frameworks_native-9a11206fe793363c0e8897b478cbe6ef8c52b543.tar.bz2
more Surface lifetime management
Surfaces are now destroyed once all references from the clients are gone, but they go through a partial destruction as soon as the window manager requests it. This last part is still buggy. see comments in SurfaceFlinger::destroySurface()
Diffstat (limited to 'libs/surfaceflinger/LayerBase.h')
-rw-r--r--libs/surfaceflinger/LayerBase.h24
1 files changed, 16 insertions, 8 deletions
diff --git a/libs/surfaceflinger/LayerBase.h b/libs/surfaceflinger/LayerBase.h
index 2a4e133..ccff36d 100644
--- a/libs/surfaceflinger/LayerBase.h
+++ b/libs/surfaceflinger/LayerBase.h
@@ -203,14 +203,19 @@ public:
/**
* isSecure - true if this surface is secure, that is if it prevents
- * screenshots or vns servers.
+ * screenshots or VNC servers.
*/
virtual bool isSecure() const { return false; }
- enum { // flags for doTransaction()
- eVisibleRegion = 0x00000002,
- eRestartTransaction = 0x00000008
- };
+ /** signal this layer that it's not needed any longer */
+ virtual status_t ditch() { return NO_ERROR; }
+
+
+
+ enum { // flags for doTransaction()
+ eVisibleRegion = 0x00000002,
+ eRestartTransaction = 0x00000008
+ };
inline const State& drawingState() const { return mDrawingState; }
@@ -244,7 +249,7 @@ protected:
GLint textureName, const GGLSurface& t,
GLuint& textureWidth, GLuint& textureHeight) const;
- SurfaceFlinger* mFlinger;
+ sp<SurfaceFlinger> mFlinger;
uint32_t mFlags;
// cached during validateVisibility()
@@ -316,7 +321,9 @@ public:
ISurfaceFlingerClient::surface_data_t* params) const;
protected:
- Surface(SurfaceID id, int identity, const sp<LayerBaseClient>& owner);
+ Surface(const sp<SurfaceFlinger>& flinger,
+ SurfaceID id, int identity,
+ const sp<LayerBaseClient>& owner);
virtual ~Surface();
virtual status_t onTransact(uint32_t code, const Parcel& data,
Parcel* reply, uint32_t flags);
@@ -330,8 +337,9 @@ public:
virtual sp<OverlayRef> createOverlay(uint32_t w, uint32_t h,
int32_t format);
- private:
+ protected:
friend class LayerBaseClient;
+ sp<SurfaceFlinger> mFlinger;
int32_t mToken;
int32_t mIdentity;
wp<LayerBaseClient> mOwner;