From f7662afb76dfafebdd449c5e3e168f050da850a0 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Wed, 9 Mar 2011 16:13:31 -0800 Subject: 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 --- services/surfaceflinger/LayerBase.cpp | 32 ++++++-------------------------- 1 file changed, 6 insertions(+), 26 deletions(-) (limited to 'services/surfaceflinger/LayerBase.cpp') diff --git a/services/surfaceflinger/LayerBase.cpp b/services/surfaceflinger/LayerBase.cpp index 0f02c6d3da..21c36e1848 100644 --- a/services/surfaceflinger/LayerBase.cpp +++ b/services/surfaceflinger/LayerBase.cpp @@ -515,21 +515,13 @@ void LayerBase::dump(String8& result, char* buffer, size_t SIZE) const result.append(buffer); } -void LayerBase::shortDump(String8& result, char* scratch, size_t size) const -{ - LayerBase::dump(result, scratch, size); -} - - // --------------------------------------------------------------------------- int32_t LayerBaseClient::sIdentity = 1; LayerBaseClient::LayerBaseClient(SurfaceFlinger* flinger, DisplayID display, const sp& client) - : LayerBase(flinger, display), - mHasSurface(false), - mClientRef(client), + : LayerBase(flinger, display), mClientRef(client), mIdentity(uint32_t(android_atomic_inc(&sIdentity))) { } @@ -546,20 +538,14 @@ sp LayerBaseClient::getSurface() { sp s; Mutex::Autolock _l(mLock); - - LOG_ALWAYS_FATAL_IF(mHasSurface, - "LayerBaseClient::getSurface() has already been called"); - - mHasSurface = true; - s = createSurface(); - mClientSurfaceBinder = s->asBinder(); + s = mClientSurface.promote(); + if (s == 0) { + s = createSurface(); + mClientSurface = s; + } return s; } -wp LayerBaseClient::getSurfaceBinder() const { - return mClientSurfaceBinder; -} - sp LayerBaseClient::createSurface() const { return new Surface(mFlinger, mIdentity, @@ -580,12 +566,6 @@ void LayerBaseClient::dump(String8& result, char* buffer, size_t SIZE) const result.append(buffer); } - -void LayerBaseClient::shortDump(String8& result, char* scratch, size_t size) const -{ - LayerBaseClient::dump(result, scratch, size); -} - // --------------------------------------------------------------------------- LayerBaseClient::Surface::Surface( -- cgit v1.2.3-59-g8ed1b