Loading services/surfaceflinger/Layer.cpp +17 −8 Original line number Diff line number Diff line Loading @@ -202,9 +202,11 @@ Layer::~Layer() { mFrameTracker.logAndResetStats(mName); #ifdef USE_HWC2 ALOGE_IF(!mHwcLayers.empty(), "Found stale hardware composer layers when destroying " "surface flinger layer"); if (!mHwcLayers.empty()) { ALOGE("Found stale hardware composer layers when destroying " "surface flinger layer %s", mName.string()); destroyAllHwcLayers(); } #endif } Loading Loading @@ -293,20 +295,27 @@ void Layer::onSidebandStreamChanged() { } } // called with SurfaceFlinger::mStateLock from the drawing thread after // the layer has been remove from the current state list (and just before // it's removed from the drawing state list) void Layer::onRemoved() { void Layer::onRemovedFromCurrentState() { // the layer is removed from SF mCurrentState to mLayersPendingRemoval if (mCurrentState.zOrderRelativeOf != nullptr) { sp<Layer> strongRelative = mCurrentState.zOrderRelativeOf.promote(); if (strongRelative != nullptr) { strongRelative->removeZOrderRelative(this); mFlinger->setTransactionFlags(eTraversalNeeded); } mCurrentState.zOrderRelativeOf = nullptr; } mSurfaceFlingerConsumer->abandon(); for (const auto& child : mCurrentChildren) { child->onRemovedFromCurrentState(); } } void Layer::onRemoved() { // the layer is removed from SF mLayersPendingRemoval mSurfaceFlingerConsumer->abandon(); #ifdef USE_HWC2 destroyAllHwcLayers(); #endif Loading services/surfaceflinger/Layer.h +8 −2 Original line number Diff line number Diff line Loading @@ -419,8 +419,14 @@ public: bool isPotentialCursor() const { return mPotentialCursor;} /* * called with the state lock when the surface is removed from the * current list * called with the state lock from a binder thread when the layer is * removed from the current list to the pending removal list */ void onRemovedFromCurrentState(); /* * called with the state lock from the main thread when the layer is * removed from the pending removal list */ void onRemoved(); Loading services/surfaceflinger/SurfaceFlinger.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -2779,6 +2779,7 @@ status_t SurfaceFlinger::removeLayer(const sp<Layer>& layer, bool topLevelOnly) return NO_ERROR; } layer->onRemovedFromCurrentState(); mLayersPendingRemoval.add(layer); mLayersRemoved = true; mNumLayers -= 1 + layer->getChildrenCount(); Loading services/surfaceflinger/SurfaceFlinger_hwc1.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -2382,6 +2382,7 @@ status_t SurfaceFlinger::removeLayer(const sp<Layer>& layer, bool topLevelOnly) return NO_ERROR; } layer->onRemovedFromCurrentState(); mLayersPendingRemoval.add(layer); mLayersRemoved = true; mNumLayers -= 1 + layer->getChildrenCount(); Loading Loading
services/surfaceflinger/Layer.cpp +17 −8 Original line number Diff line number Diff line Loading @@ -202,9 +202,11 @@ Layer::~Layer() { mFrameTracker.logAndResetStats(mName); #ifdef USE_HWC2 ALOGE_IF(!mHwcLayers.empty(), "Found stale hardware composer layers when destroying " "surface flinger layer"); if (!mHwcLayers.empty()) { ALOGE("Found stale hardware composer layers when destroying " "surface flinger layer %s", mName.string()); destroyAllHwcLayers(); } #endif } Loading Loading @@ -293,20 +295,27 @@ void Layer::onSidebandStreamChanged() { } } // called with SurfaceFlinger::mStateLock from the drawing thread after // the layer has been remove from the current state list (and just before // it's removed from the drawing state list) void Layer::onRemoved() { void Layer::onRemovedFromCurrentState() { // the layer is removed from SF mCurrentState to mLayersPendingRemoval if (mCurrentState.zOrderRelativeOf != nullptr) { sp<Layer> strongRelative = mCurrentState.zOrderRelativeOf.promote(); if (strongRelative != nullptr) { strongRelative->removeZOrderRelative(this); mFlinger->setTransactionFlags(eTraversalNeeded); } mCurrentState.zOrderRelativeOf = nullptr; } mSurfaceFlingerConsumer->abandon(); for (const auto& child : mCurrentChildren) { child->onRemovedFromCurrentState(); } } void Layer::onRemoved() { // the layer is removed from SF mLayersPendingRemoval mSurfaceFlingerConsumer->abandon(); #ifdef USE_HWC2 destroyAllHwcLayers(); #endif Loading
services/surfaceflinger/Layer.h +8 −2 Original line number Diff line number Diff line Loading @@ -419,8 +419,14 @@ public: bool isPotentialCursor() const { return mPotentialCursor;} /* * called with the state lock when the surface is removed from the * current list * called with the state lock from a binder thread when the layer is * removed from the current list to the pending removal list */ void onRemovedFromCurrentState(); /* * called with the state lock from the main thread when the layer is * removed from the pending removal list */ void onRemoved(); Loading
services/surfaceflinger/SurfaceFlinger.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -2779,6 +2779,7 @@ status_t SurfaceFlinger::removeLayer(const sp<Layer>& layer, bool topLevelOnly) return NO_ERROR; } layer->onRemovedFromCurrentState(); mLayersPendingRemoval.add(layer); mLayersRemoved = true; mNumLayers -= 1 + layer->getChildrenCount(); Loading
services/surfaceflinger/SurfaceFlinger_hwc1.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -2382,6 +2382,7 @@ status_t SurfaceFlinger::removeLayer(const sp<Layer>& layer, bool topLevelOnly) return NO_ERROR; } layer->onRemovedFromCurrentState(); mLayersPendingRemoval.add(layer); mLayersRemoved = true; mNumLayers -= 1 + layer->getChildrenCount(); Loading