summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/Layer.cpp
diff options
context:
space:
mode:
author Mathias Agopian <mathias@google.com> 2011-03-09 16:13:31 -0800
committer Mathias Agopian <mathias@google.com> 2011-03-09 17:00:41 -0800
commitf7662afb76dfafebdd449c5e3e168f050da850a0 (patch)
tree0634de38377d2847c6adc9ae88c550beef48ac7a /services/surfaceflinger/Layer.cpp
parentf4e1ef0794e3ebde4ecbe46d717247b309cc6fa6 (diff)
revert the surface purgatory list and dependent changes.
6d0f6cb Revert "Fix [3513017] in lockscreen but showing empty launcher (live wallpaper) only" 6154412 Revert "partially fix [3306150] HTML5 video with H/W acceleration blackout (DO NOT MERGE)" 37c2a37 fix [3408713] Dialog window invisible sometimes It looks like there is a surface leak, it's unclear where it is. Without those reverts, this would cause a leak of the associated buffers which is far more problematic. this change might hide the surface leak. Bug: 4078032 Change-Id: Iedcda3ffcdd2f69d41047b5c3134c1e867ff90d7
Diffstat (limited to 'services/surfaceflinger/Layer.cpp')
-rw-r--r--services/surfaceflinger/Layer.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index e3cf27e0ff..c9dcef370a 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -120,8 +120,7 @@ void Layer::onRemoved()
sp<LayerBaseClient::Surface> Layer::createSurface() const
{
- sp<Surface> sur(new SurfaceLayer(mFlinger, const_cast<Layer *>(this)));
- return sur;
+ return mSurface;
}
status_t Layer::ditch()
@@ -131,6 +130,10 @@ status_t Layer::ditch()
// 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;
@@ -175,6 +178,7 @@ status_t Layer::setBuffers( uint32_t w, uint32_t h,
int layerRedsize = info.getSize(PixelFormatInfo::INDEX_RED);
mNeedsDithering = layerRedsize > displayRedSize;
+ mSurface = new SurfaceLayer(mFlinger, this);
return NO_ERROR;
}