Loading services/surfaceflinger/Layer.cpp +2 −5 Original line number Diff line number Diff line Loading @@ -142,7 +142,8 @@ void Layer::onRemoved() sp<LayerBaseClient::Surface> Layer::createSurface() const { return mSurface; sp<Surface> sur(new SurfaceLayer(mFlinger, const_cast<Layer *>(this))); return sur; } status_t Layer::ditch() Loading @@ -152,9 +153,6 @@ status_t Layer::ditch() // the layer is not on screen anymore. free as much resources as possible mFreezeLock.clear(); // Free our own reference to ISurface mSurface.clear(); Mutex::Autolock _l(mLock); mWidth = mHeight = 0; return NO_ERROR; Loading Loading @@ -202,7 +200,6 @@ 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; } Loading services/surfaceflinger/Layer.h +0 −1 Original line number Diff line number Diff line Loading @@ -213,7 +213,6 @@ private: ClientRef mUserClientRef; // constants sp<Surface> mSurface; PixelFormat mFormat; const GLExtensions& mGLExtensions; bool mNeedsBlending; Loading services/surfaceflinger/LayerBase.cpp +10 −7 Original line number Diff line number Diff line Loading @@ -540,7 +540,9 @@ int32_t LayerBaseClient::sIdentity = 1; LayerBaseClient::LayerBaseClient(SurfaceFlinger* flinger, DisplayID display, const sp<Client>& client) : LayerBase(flinger, display), mClientRef(client), : LayerBase(flinger, display), mHasSurface(false), mClientRef(client), mIdentity(uint32_t(android_atomic_inc(&sIdentity))) { } Loading @@ -557,12 +559,13 @@ sp<LayerBaseClient::Surface> LayerBaseClient::getSurface() { sp<Surface> s; Mutex::Autolock _l(mLock); s = mClientSurface.promote(); if (s == 0) { LOG_ALWAYS_FATAL_IF(mHasSurface, "LayerBaseClient::getSurface() has already been called"); mHasSurface = true; s = createSurface(); mClientSurface = s; mClientSurfaceBinder = s->asBinder(); } return s; } Loading services/surfaceflinger/LayerBase.h +1 −1 Original line number Diff line number Diff line Loading @@ -337,7 +337,7 @@ protected: private: mutable Mutex mLock; mutable wp<Surface> mClientSurface; mutable bool mHasSurface; wp<IBinder> mClientSurfaceBinder; const wp<Client> mClientRef; // only read Loading Loading
services/surfaceflinger/Layer.cpp +2 −5 Original line number Diff line number Diff line Loading @@ -142,7 +142,8 @@ void Layer::onRemoved() sp<LayerBaseClient::Surface> Layer::createSurface() const { return mSurface; sp<Surface> sur(new SurfaceLayer(mFlinger, const_cast<Layer *>(this))); return sur; } status_t Layer::ditch() Loading @@ -152,9 +153,6 @@ status_t Layer::ditch() // the layer is not on screen anymore. free as much resources as possible mFreezeLock.clear(); // Free our own reference to ISurface mSurface.clear(); Mutex::Autolock _l(mLock); mWidth = mHeight = 0; return NO_ERROR; Loading Loading @@ -202,7 +200,6 @@ 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; } Loading
services/surfaceflinger/Layer.h +0 −1 Original line number Diff line number Diff line Loading @@ -213,7 +213,6 @@ private: ClientRef mUserClientRef; // constants sp<Surface> mSurface; PixelFormat mFormat; const GLExtensions& mGLExtensions; bool mNeedsBlending; Loading
services/surfaceflinger/LayerBase.cpp +10 −7 Original line number Diff line number Diff line Loading @@ -540,7 +540,9 @@ int32_t LayerBaseClient::sIdentity = 1; LayerBaseClient::LayerBaseClient(SurfaceFlinger* flinger, DisplayID display, const sp<Client>& client) : LayerBase(flinger, display), mClientRef(client), : LayerBase(flinger, display), mHasSurface(false), mClientRef(client), mIdentity(uint32_t(android_atomic_inc(&sIdentity))) { } Loading @@ -557,12 +559,13 @@ sp<LayerBaseClient::Surface> LayerBaseClient::getSurface() { sp<Surface> s; Mutex::Autolock _l(mLock); s = mClientSurface.promote(); if (s == 0) { LOG_ALWAYS_FATAL_IF(mHasSurface, "LayerBaseClient::getSurface() has already been called"); mHasSurface = true; s = createSurface(); mClientSurface = s; mClientSurfaceBinder = s->asBinder(); } return s; } Loading
services/surfaceflinger/LayerBase.h +1 −1 Original line number Diff line number Diff line Loading @@ -337,7 +337,7 @@ protected: private: mutable Mutex mLock; mutable wp<Surface> mClientSurface; mutable bool mHasSurface; wp<IBinder> mClientSurfaceBinder; const wp<Client> mClientRef; // only read Loading