Loading services/surfaceflinger/Client.cpp +3 −32 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ #include "Client.h" #include "FrontEnd/LayerCreationArgs.h" #include "FrontEnd/LayerHandle.h" #include "Layer.h" #include "SurfaceFlinger.h" Loading @@ -47,36 +48,6 @@ status_t Client::initCheck() const { return NO_ERROR; } void Client::attachLayer(const sp<IBinder>& handle, const sp<Layer>& layer) { Mutex::Autolock _l(mLock); mLayers.add(handle, layer); } void Client::detachLayer(const Layer* layer) { Mutex::Autolock _l(mLock); // we do a linear search here, because this doesn't happen often const size_t count = mLayers.size(); for (size_t i=0 ; i<count ; i++) { if (mLayers.valueAt(i) == layer) { mLayers.removeItemsAt(i, 1); break; } } } sp<Layer> Client::getLayerUser(const sp<IBinder>& handle) const { Mutex::Autolock _l(mLock); sp<Layer> lbc; wp<Layer> layer(mLayers.valueFor(handle)); if (layer != 0) { lbc = layer.promote(); ALOGE_IF(lbc==0, "getLayerUser(name=%p) is dead", handle.get()); } return lbc; } binder::Status Client::createSurface(const std::string& name, int32_t flags, const sp<IBinder>& parent, const gui::LayerMetadata& metadata, gui::CreateSurfaceResult* outResult) { Loading @@ -91,7 +62,7 @@ binder::Status Client::createSurface(const std::string& name, int32_t flags, binder::Status Client::clearLayerFrameStats(const sp<IBinder>& handle) { status_t status; sp<Layer> layer = getLayerUser(handle); sp<Layer> layer = LayerHandle::getLayer(handle); if (layer == nullptr) { status = NAME_NOT_FOUND; } else { Loading @@ -103,7 +74,7 @@ binder::Status Client::clearLayerFrameStats(const sp<IBinder>& handle) { binder::Status Client::getLayerFrameStats(const sp<IBinder>& handle, gui::FrameStats* outStats) { status_t status; sp<Layer> layer = getLayerUser(handle); sp<Layer> layer = LayerHandle::getLayer(handle); if (layer == nullptr) { status = NAME_NOT_FOUND; } else { Loading services/surfaceflinger/Client.h +0 −9 Original line number Diff line number Diff line Loading @@ -38,12 +38,6 @@ public: status_t initCheck() const; // protected by SurfaceFlinger::mStateLock void attachLayer(const sp<IBinder>& handle, const sp<Layer>& layer); void detachLayer(const Layer* layer); sp<Layer> getLayerUser(const sp<IBinder>& handle) const; private: // ISurfaceComposerClient interface Loading @@ -64,9 +58,6 @@ private: // constant sp<SurfaceFlinger> mFlinger; // protected by mLock DefaultKeyedVector< wp<IBinder>, wp<Layer> > mLayers; // thread-safe mutable Mutex mLock; }; Loading services/surfaceflinger/Layer.cpp +0 −5 Original line number Diff line number Diff line Loading @@ -240,11 +240,6 @@ Layer::~Layer() { mFlinger->mTimeStats->onDestroy(layerId); mFlinger->mFrameTracer->onDestroy(layerId); sp<Client> c(mClientRef.promote()); if (c != 0) { c->detachLayer(this); } mFrameTracker.logAndResetStats(mName); mFlinger->onLayerDestroyed(this); Loading services/surfaceflinger/SurfaceFlinger.cpp +0 −5 Original line number Diff line number Diff line Loading @@ -3641,11 +3641,6 @@ status_t SurfaceFlinger::addClientLayer(const LayerCreationArgs& args, const sp< mCreatedLayers.emplace_back(layer, parent, args.addToRoot); } // attach this layer to the client if (args.client != nullptr) { args.client->attachLayer(handle, layer); } setTransactionFlags(eTransactionNeeded); return NO_ERROR; } Loading Loading
services/surfaceflinger/Client.cpp +3 −32 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ #include "Client.h" #include "FrontEnd/LayerCreationArgs.h" #include "FrontEnd/LayerHandle.h" #include "Layer.h" #include "SurfaceFlinger.h" Loading @@ -47,36 +48,6 @@ status_t Client::initCheck() const { return NO_ERROR; } void Client::attachLayer(const sp<IBinder>& handle, const sp<Layer>& layer) { Mutex::Autolock _l(mLock); mLayers.add(handle, layer); } void Client::detachLayer(const Layer* layer) { Mutex::Autolock _l(mLock); // we do a linear search here, because this doesn't happen often const size_t count = mLayers.size(); for (size_t i=0 ; i<count ; i++) { if (mLayers.valueAt(i) == layer) { mLayers.removeItemsAt(i, 1); break; } } } sp<Layer> Client::getLayerUser(const sp<IBinder>& handle) const { Mutex::Autolock _l(mLock); sp<Layer> lbc; wp<Layer> layer(mLayers.valueFor(handle)); if (layer != 0) { lbc = layer.promote(); ALOGE_IF(lbc==0, "getLayerUser(name=%p) is dead", handle.get()); } return lbc; } binder::Status Client::createSurface(const std::string& name, int32_t flags, const sp<IBinder>& parent, const gui::LayerMetadata& metadata, gui::CreateSurfaceResult* outResult) { Loading @@ -91,7 +62,7 @@ binder::Status Client::createSurface(const std::string& name, int32_t flags, binder::Status Client::clearLayerFrameStats(const sp<IBinder>& handle) { status_t status; sp<Layer> layer = getLayerUser(handle); sp<Layer> layer = LayerHandle::getLayer(handle); if (layer == nullptr) { status = NAME_NOT_FOUND; } else { Loading @@ -103,7 +74,7 @@ binder::Status Client::clearLayerFrameStats(const sp<IBinder>& handle) { binder::Status Client::getLayerFrameStats(const sp<IBinder>& handle, gui::FrameStats* outStats) { status_t status; sp<Layer> layer = getLayerUser(handle); sp<Layer> layer = LayerHandle::getLayer(handle); if (layer == nullptr) { status = NAME_NOT_FOUND; } else { Loading
services/surfaceflinger/Client.h +0 −9 Original line number Diff line number Diff line Loading @@ -38,12 +38,6 @@ public: status_t initCheck() const; // protected by SurfaceFlinger::mStateLock void attachLayer(const sp<IBinder>& handle, const sp<Layer>& layer); void detachLayer(const Layer* layer); sp<Layer> getLayerUser(const sp<IBinder>& handle) const; private: // ISurfaceComposerClient interface Loading @@ -64,9 +58,6 @@ private: // constant sp<SurfaceFlinger> mFlinger; // protected by mLock DefaultKeyedVector< wp<IBinder>, wp<Layer> > mLayers; // thread-safe mutable Mutex mLock; }; Loading
services/surfaceflinger/Layer.cpp +0 −5 Original line number Diff line number Diff line Loading @@ -240,11 +240,6 @@ Layer::~Layer() { mFlinger->mTimeStats->onDestroy(layerId); mFlinger->mFrameTracer->onDestroy(layerId); sp<Client> c(mClientRef.promote()); if (c != 0) { c->detachLayer(this); } mFrameTracker.logAndResetStats(mName); mFlinger->onLayerDestroyed(this); Loading
services/surfaceflinger/SurfaceFlinger.cpp +0 −5 Original line number Diff line number Diff line Loading @@ -3641,11 +3641,6 @@ status_t SurfaceFlinger::addClientLayer(const LayerCreationArgs& args, const sp< mCreatedLayers.emplace_back(layer, parent, args.addToRoot); } // attach this layer to the client if (args.client != nullptr) { args.client->attachLayer(handle, layer); } setTransactionFlags(eTransactionNeeded); return NO_ERROR; } Loading