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/Layer.cpp | |
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/Layer.cpp')
-rw-r--r-- | libs/surfaceflinger/Layer.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/libs/surfaceflinger/Layer.cpp b/libs/surfaceflinger/Layer.cpp index 980b78b..5fdec3f 100644 --- a/libs/surfaceflinger/Layer.cpp +++ b/libs/surfaceflinger/Layer.cpp @@ -87,6 +87,12 @@ sp<LayerBaseClient::Surface> Layer::createSurface() const return mSurface; } +status_t Layer::ditch() +{ + mSurface.clear(); + return NO_ERROR; +} + status_t Layer::setBuffers( Client* client, uint32_t w, uint32_t h, PixelFormat format, uint32_t flags) @@ -119,7 +125,7 @@ status_t Layer::setBuffers( Client* client, return err; } } - mSurface = new SurfaceLayer(clientIndex(), this); + mSurface = new SurfaceLayer(mFlinger, clientIndex(), this); return NO_ERROR; } @@ -626,8 +632,13 @@ void Layer::finishPageFlip() // --------------------------------------------------------------------------- -Layer::SurfaceLayer::SurfaceLayer(SurfaceID id, const sp<Layer>& owner) - : Surface(id, owner->getIdentity(), owner) +Layer::SurfaceLayer::SurfaceLayer(const sp<SurfaceFlinger>& flinger, + SurfaceID id, const sp<Layer>& owner) + : Surface(flinger, id, owner->getIdentity(), owner) +{ +} + +Layer::SurfaceLayer::~SurfaceLayer() { } |