diff options
author | 2011-05-24 17:07:39 -0700 | |
---|---|---|
committer | 2011-05-24 17:07:39 -0700 | |
commit | c9cd2387b6938a6fbefc731d2177902266f2a130 (patch) | |
tree | b6b7f4ca61ee3c9d29e1c2d1ded10993e4cca4a0 /services/surfaceflinger/Layer.cpp | |
parent | 34f5991ebe8b203f1720caf95889c15dd131d86e (diff) | |
parent | 6f96080f333c70104424f42ac263c4c9c7a9dd2a (diff) |
Merge changes I37f0f315,I8cbf6044,Ibb598931,I5262bf11 into gingerbread
* changes:
Fix a race that could cause GL commands to be executed from the wrong thread.
RefBase subclasses can now decide how they want to be destroyed.
Fix a race in SurfaceFlinger that could cause layers to be leaked forever.
Fix a race-condtion in SurfaceFlinger that could lead to a crash.
Diffstat (limited to 'services/surfaceflinger/Layer.cpp')
-rw-r--r-- | services/surfaceflinger/Layer.cpp | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index c9dcef370a4d..4739cc3072c1 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -76,6 +76,10 @@ Layer::~Layer() } } +void Layer::destroy() const { + mFlinger->destroyLayer(this); +} + status_t Layer::setToken(const sp<UserClient>& userClient, SharedClient* sharedClient, int32_t token) { @@ -123,22 +127,6 @@ sp<LayerBaseClient::Surface> Layer::createSurface() const return mSurface; } -status_t Layer::ditch() -{ - // NOTE: Called from the main UI thread - - // the layer is not on screen anymore. free as much resources as possible - mFreezeLock.clear(); - - EGLDisplay dpy(mFlinger->graphicPlane(0).getEGLDisplay()); - mBufferManager.destroy(dpy); - mSurface.clear(); - - Mutex::Autolock _l(mLock); - mWidth = mHeight = 0; - return NO_ERROR; -} - status_t Layer::setBuffers( uint32_t w, uint32_t h, PixelFormat format, uint32_t flags) { |