summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/Layer.cpp
diff options
context:
space:
mode:
author Mathias Agopian <mathias@google.com> 2011-03-09 17:07:27 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2011-03-09 17:07:27 -0800
commitc1315657bd06ed0796a7dd53e486299c24fca6e2 (patch)
tree0634de38377d2847c6adc9ae88c550beef48ac7a /services/surfaceflinger/Layer.cpp
parente379402df1cf4d823ce2116582ab0bebfb92c42f (diff)
parentf7662afb76dfafebdd449c5e3e168f050da850a0 (diff)
Merge "revert the surface purgatory list and dependent changes." into gingerbread
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;
}