Loading services/surfaceflinger/Layer.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -317,7 +317,6 @@ void Layer::addToCurrentState() { if (mRemovedFromDrawingState) { mRemovedFromDrawingState = false; mFlinger->mScheduler->registerLayer(this, FrameRateCompatibility::Default); mFlinger->removeFromOffscreenLayers(this); } for (const auto& child : mCurrentChildren) { Loading services/surfaceflinger/SurfaceFlinger.cpp +0 −38 Original line number Diff line number Diff line Loading @@ -4369,13 +4369,6 @@ void SurfaceFlinger::doCommitTransactions() { l->setIsAtRoot(false); mCurrentState.layersSortedByZ.remove(l); } // If the layer has been removed and has no parent, then it will not be reachable // when traversing layers on screen. Add the layer to the offscreenLayers set to // ensure we can copy its current to drawing state. if (!l->getParent()) { mOffscreenLayers.emplace(l.get()); } } mLayersPendingRemoval.clear(); } Loading @@ -4389,7 +4382,6 @@ void SurfaceFlinger::doCommitTransactions() { } } commitOffscreenLayers(); if (mLayerMirrorRoots.size() > 0) { std::deque<Layer*> pendingUpdates; pendingUpdates.insert(pendingUpdates.end(), mLayerMirrorRoots.begin(), Loading @@ -4411,17 +4403,6 @@ void SurfaceFlinger::doCommitTransactions() { } } void SurfaceFlinger::commitOffscreenLayers() { for (Layer* offscreenLayer : mOffscreenLayers) { offscreenLayer->traverse(LayerVector::StateSet::Drawing, [](Layer* layer) { if (layer->clearTransactionFlags(eTransactionNeeded)) { layer->doTransaction(0); layer->commitChildList(); } }); } } void SurfaceFlinger::invalidateLayerStack(const ui::LayerFilter& layerFilter, const Region& dirty) { for (const auto& [token, displayDevice] : FTL_FAKE_GUARD(mStateLock, mDisplays)) { auto display = displayDevice->getCompositionDisplay(); Loading Loading @@ -7901,7 +7882,6 @@ void SurfaceFlinger::onLayerFirstRef(Layer* layer) { void SurfaceFlinger::onLayerDestroyed(Layer* layer) { mNumLayers--; removeHierarchyFromOffscreenLayers(layer); if (!layer->isRemovedFromCurrentState()) { mScheduler->deregisterLayer(layer); } Loading @@ -7915,24 +7895,6 @@ void SurfaceFlinger::onLayerUpdate() { scheduleCommit(FrameHint::kActive); } // WARNING: ONLY CALL THIS FROM LAYER DTOR // Here we add children in the current state to offscreen layers and remove the // layer itself from the offscreen layer list. Since // this is the dtor, it is safe to access the current state. This keeps us // from dangling children layers such that they are not reachable from the // Drawing state nor the offscreen layer list // See b/141111965 void SurfaceFlinger::removeHierarchyFromOffscreenLayers(Layer* layer) { for (auto& child : layer->getCurrentChildren()) { mOffscreenLayers.emplace(child.get()); } mOffscreenLayers.erase(layer); } void SurfaceFlinger::removeFromOffscreenLayers(Layer* layer) { mOffscreenLayers.erase(layer); } status_t SurfaceFlinger::setGlobalShadowSettings(const half4& ambientColor, const half4& spotColor, float lightPosY, float lightPosZ, float lightRadius) { Loading services/surfaceflinger/SurfaceFlinger.h +0 −11 Original line number Diff line number Diff line Loading @@ -292,9 +292,6 @@ public: void onLayerDestroyed(Layer*); void onLayerUpdate(); void removeHierarchyFromOffscreenLayers(Layer* layer); void removeFromOffscreenLayers(Layer* layer); // Called when all clients have released all their references to // this layer. The layer may still be kept alive by its parents but // the client can no longer modify this layer directly. Loading Loading @@ -824,8 +821,6 @@ private: // Clears and returns the masked bits. uint32_t clearTransactionFlags(uint32_t mask); void commitOffscreenLayers(); static LatchUnsignaledConfig getLatchUnsignaledConfig(); bool shouldLatchUnsignaled(const layer_state_t&, size_t numStates, bool firstTransaction) const; bool applyTransactionsLocked(std::vector<TransactionState>& transactions, VsyncId) Loading Loading @@ -1392,12 +1387,6 @@ private: // Flag used to set override desired display mode from backdoor bool mDebugDisplayModeSetByBackdoor = false; // A set of layers that have no parent so they are not drawn on screen. // Should only be accessed by the main thread. // The Layer pointer is removed from the set when the destructor is called so there shouldn't // be any issues with a raw pointer referencing an invalid object. std::unordered_set<Layer*> mOffscreenLayers; BufferCountTracker mBufferCountTracker; std::unordered_map<DisplayId, sp<HdrLayerInfoReporter>> mHdrLayerInfoListeners Loading Loading
services/surfaceflinger/Layer.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -317,7 +317,6 @@ void Layer::addToCurrentState() { if (mRemovedFromDrawingState) { mRemovedFromDrawingState = false; mFlinger->mScheduler->registerLayer(this, FrameRateCompatibility::Default); mFlinger->removeFromOffscreenLayers(this); } for (const auto& child : mCurrentChildren) { Loading
services/surfaceflinger/SurfaceFlinger.cpp +0 −38 Original line number Diff line number Diff line Loading @@ -4369,13 +4369,6 @@ void SurfaceFlinger::doCommitTransactions() { l->setIsAtRoot(false); mCurrentState.layersSortedByZ.remove(l); } // If the layer has been removed and has no parent, then it will not be reachable // when traversing layers on screen. Add the layer to the offscreenLayers set to // ensure we can copy its current to drawing state. if (!l->getParent()) { mOffscreenLayers.emplace(l.get()); } } mLayersPendingRemoval.clear(); } Loading @@ -4389,7 +4382,6 @@ void SurfaceFlinger::doCommitTransactions() { } } commitOffscreenLayers(); if (mLayerMirrorRoots.size() > 0) { std::deque<Layer*> pendingUpdates; pendingUpdates.insert(pendingUpdates.end(), mLayerMirrorRoots.begin(), Loading @@ -4411,17 +4403,6 @@ void SurfaceFlinger::doCommitTransactions() { } } void SurfaceFlinger::commitOffscreenLayers() { for (Layer* offscreenLayer : mOffscreenLayers) { offscreenLayer->traverse(LayerVector::StateSet::Drawing, [](Layer* layer) { if (layer->clearTransactionFlags(eTransactionNeeded)) { layer->doTransaction(0); layer->commitChildList(); } }); } } void SurfaceFlinger::invalidateLayerStack(const ui::LayerFilter& layerFilter, const Region& dirty) { for (const auto& [token, displayDevice] : FTL_FAKE_GUARD(mStateLock, mDisplays)) { auto display = displayDevice->getCompositionDisplay(); Loading Loading @@ -7901,7 +7882,6 @@ void SurfaceFlinger::onLayerFirstRef(Layer* layer) { void SurfaceFlinger::onLayerDestroyed(Layer* layer) { mNumLayers--; removeHierarchyFromOffscreenLayers(layer); if (!layer->isRemovedFromCurrentState()) { mScheduler->deregisterLayer(layer); } Loading @@ -7915,24 +7895,6 @@ void SurfaceFlinger::onLayerUpdate() { scheduleCommit(FrameHint::kActive); } // WARNING: ONLY CALL THIS FROM LAYER DTOR // Here we add children in the current state to offscreen layers and remove the // layer itself from the offscreen layer list. Since // this is the dtor, it is safe to access the current state. This keeps us // from dangling children layers such that they are not reachable from the // Drawing state nor the offscreen layer list // See b/141111965 void SurfaceFlinger::removeHierarchyFromOffscreenLayers(Layer* layer) { for (auto& child : layer->getCurrentChildren()) { mOffscreenLayers.emplace(child.get()); } mOffscreenLayers.erase(layer); } void SurfaceFlinger::removeFromOffscreenLayers(Layer* layer) { mOffscreenLayers.erase(layer); } status_t SurfaceFlinger::setGlobalShadowSettings(const half4& ambientColor, const half4& spotColor, float lightPosY, float lightPosZ, float lightRadius) { Loading
services/surfaceflinger/SurfaceFlinger.h +0 −11 Original line number Diff line number Diff line Loading @@ -292,9 +292,6 @@ public: void onLayerDestroyed(Layer*); void onLayerUpdate(); void removeHierarchyFromOffscreenLayers(Layer* layer); void removeFromOffscreenLayers(Layer* layer); // Called when all clients have released all their references to // this layer. The layer may still be kept alive by its parents but // the client can no longer modify this layer directly. Loading Loading @@ -824,8 +821,6 @@ private: // Clears and returns the masked bits. uint32_t clearTransactionFlags(uint32_t mask); void commitOffscreenLayers(); static LatchUnsignaledConfig getLatchUnsignaledConfig(); bool shouldLatchUnsignaled(const layer_state_t&, size_t numStates, bool firstTransaction) const; bool applyTransactionsLocked(std::vector<TransactionState>& transactions, VsyncId) Loading Loading @@ -1392,12 +1387,6 @@ private: // Flag used to set override desired display mode from backdoor bool mDebugDisplayModeSetByBackdoor = false; // A set of layers that have no parent so they are not drawn on screen. // Should only be accessed by the main thread. // The Layer pointer is removed from the set when the destructor is called so there shouldn't // be any issues with a raw pointer referencing an invalid object. std::unordered_set<Layer*> mOffscreenLayers; BufferCountTracker mBufferCountTracker; std::unordered_map<DisplayId, sp<HdrLayerInfoReporter>> mHdrLayerInfoListeners Loading