diff options
author | Mathias Agopian <mathias@google.com> | 2009-04-17 19:36:26 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2009-04-24 15:00:41 -0700 |
commit | 9a11206fe793363c0e8897b478cbe6ef8c52b543 (patch) | |
tree | 0b7fc29027a6803e1ab992f47f0dd66c2a3e3843 /libs/surfaceflinger/LayerBuffer.h | |
parent | 9f88afb013a7560bf1362d7999a4609e38d0ea77 (diff) | |
download | frameworks_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/LayerBuffer.h')
-rw-r--r-- | libs/surfaceflinger/LayerBuffer.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libs/surfaceflinger/LayerBuffer.h b/libs/surfaceflinger/LayerBuffer.h index 2d44121..5284409 100644 --- a/libs/surfaceflinger/LayerBuffer.h +++ b/libs/surfaceflinger/LayerBuffer.h @@ -50,7 +50,6 @@ class LayerBuffer : public LayerBaseClient LayerBuffer& mLayer; }; - public: static const uint32_t typeInfo; static const char* const typeID; @@ -61,9 +60,11 @@ public: Client* client, int32_t i); virtual ~LayerBuffer(); + virtual void onFirstRef(); virtual bool needsBlending() const; virtual sp<LayerBaseClient::Surface> createSurface() const; + virtual status_t ditch(); virtual void onDraw(const Region& clip) const; virtual uint32_t doTransaction(uint32_t flags); virtual void unlockPageFlip(const Transform& planeTransform, Region& outDirtyRegion); @@ -177,7 +178,8 @@ private: class SurfaceBuffer : public LayerBaseClient::Surface { public: - SurfaceBuffer(SurfaceID id, const sp<LayerBuffer>& owner); + SurfaceBuffer(const sp<SurfaceFlinger>& flinger, + SurfaceID id, const sp<LayerBuffer>& owner); virtual ~SurfaceBuffer(); virtual status_t registerBuffers(const ISurface::BufferHeap& buffers); @@ -191,12 +193,10 @@ private: return static_cast<LayerBuffer*>(Surface::getOwner().get()); } }; - - friend class SurfaceFlinger; - sp<SurfaceBuffer> getClientSurface() const; - + mutable Mutex mLock; sp<Source> mSource; + sp<Surface> mSurface; bool mInvalidate; bool mNeedsBlending; }; |