Loading services/surfaceflinger/FrontEnd/LayerSnapshotBuilder.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -1265,6 +1265,12 @@ void LayerSnapshotBuilder::forEachSnapshot(const Visitor& visitor, } } void LayerSnapshotBuilder::forEachSnapshot(const ConstVisitor& visitor) const { for (auto& snapshot : mSnapshots) { visitor(*snapshot); } } void LayerSnapshotBuilder::forEachInputSnapshot(const ConstVisitor& visitor) const { for (int i = mNumInterestingSnapshots - 1; i >= 0; i--) { LayerSnapshot& snapshot = *mSnapshots[(size_t)i]; Loading services/surfaceflinger/FrontEnd/LayerSnapshotBuilder.h +3 −0 Original line number Diff line number Diff line Loading @@ -91,6 +91,9 @@ public: // snapshots in z-order void forEachSnapshot(const Visitor& visitor, const ConstPredicate& predicate); // Visit each snapshot void forEachSnapshot(const ConstVisitor& visitor) const; // Visit each snapshot interesting to input reverse z-order void forEachInputSnapshot(const ConstVisitor& visitor) const; Loading services/surfaceflinger/SurfaceFlinger.cpp +12 −14 Original line number Diff line number Diff line Loading @@ -2520,12 +2520,18 @@ bool SurfaceFlinger::updateLayerSnapshots(VsyncId vsyncId, nsecs_t frameTimeNs, } updateLayerHistory(latchTime); mLayerSnapshotBuilder.forEachVisibleSnapshot([&](const frontend::LayerSnapshot& snapshot) { if (mLayersIdsWithQueuedFrames.find(snapshot.path.id) == mLayersIdsWithQueuedFrames.end()) return; mLayerSnapshotBuilder.forEachSnapshot([&](const frontend::LayerSnapshot& snapshot) { // update output dirty region if we have a queued buffer that is visible or a snapshot // recently became invisible // TODO(b/360050020) investigate if we need to update dirty region when layer color changes if ((snapshot.isVisible && (mLayersIdsWithQueuedFrames.find(snapshot.path.id) != mLayersIdsWithQueuedFrames.end())) || (!snapshot.isVisible && snapshot.changes.test(Changes::Visibility))) { Region visibleReg; visibleReg.set(snapshot.transformedBoundsWithoutTransparentRegion); invalidateLayerStack(snapshot.outputFilter, visibleReg); } }); for (auto& destroyedLayer : mLayerLifecycleManager.getDestroyedLayers()) { Loading Loading @@ -3984,14 +3990,6 @@ void SurfaceFlinger::commitTransactionsLocked(uint32_t transactionFlags) { mLayersRemoved = false; mVisibleRegionsDirty = true; mUpdateInputInfo = true; mDrawingState.traverseInZOrder([&](Layer* layer) { if (mLayersPendingRemoval.indexOf(sp<Layer>::fromExisting(layer)) >= 0) { // this layer is not visible anymore Region visibleReg; visibleReg.set(layer->getScreenBounds()); invalidateLayerStack(layer->getOutputFilter(), visibleReg); } }); } if (transactionFlags & eInputInfoUpdateNeeded) { Loading Loading
services/surfaceflinger/FrontEnd/LayerSnapshotBuilder.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -1265,6 +1265,12 @@ void LayerSnapshotBuilder::forEachSnapshot(const Visitor& visitor, } } void LayerSnapshotBuilder::forEachSnapshot(const ConstVisitor& visitor) const { for (auto& snapshot : mSnapshots) { visitor(*snapshot); } } void LayerSnapshotBuilder::forEachInputSnapshot(const ConstVisitor& visitor) const { for (int i = mNumInterestingSnapshots - 1; i >= 0; i--) { LayerSnapshot& snapshot = *mSnapshots[(size_t)i]; Loading
services/surfaceflinger/FrontEnd/LayerSnapshotBuilder.h +3 −0 Original line number Diff line number Diff line Loading @@ -91,6 +91,9 @@ public: // snapshots in z-order void forEachSnapshot(const Visitor& visitor, const ConstPredicate& predicate); // Visit each snapshot void forEachSnapshot(const ConstVisitor& visitor) const; // Visit each snapshot interesting to input reverse z-order void forEachInputSnapshot(const ConstVisitor& visitor) const; Loading
services/surfaceflinger/SurfaceFlinger.cpp +12 −14 Original line number Diff line number Diff line Loading @@ -2520,12 +2520,18 @@ bool SurfaceFlinger::updateLayerSnapshots(VsyncId vsyncId, nsecs_t frameTimeNs, } updateLayerHistory(latchTime); mLayerSnapshotBuilder.forEachVisibleSnapshot([&](const frontend::LayerSnapshot& snapshot) { if (mLayersIdsWithQueuedFrames.find(snapshot.path.id) == mLayersIdsWithQueuedFrames.end()) return; mLayerSnapshotBuilder.forEachSnapshot([&](const frontend::LayerSnapshot& snapshot) { // update output dirty region if we have a queued buffer that is visible or a snapshot // recently became invisible // TODO(b/360050020) investigate if we need to update dirty region when layer color changes if ((snapshot.isVisible && (mLayersIdsWithQueuedFrames.find(snapshot.path.id) != mLayersIdsWithQueuedFrames.end())) || (!snapshot.isVisible && snapshot.changes.test(Changes::Visibility))) { Region visibleReg; visibleReg.set(snapshot.transformedBoundsWithoutTransparentRegion); invalidateLayerStack(snapshot.outputFilter, visibleReg); } }); for (auto& destroyedLayer : mLayerLifecycleManager.getDestroyedLayers()) { Loading Loading @@ -3984,14 +3990,6 @@ void SurfaceFlinger::commitTransactionsLocked(uint32_t transactionFlags) { mLayersRemoved = false; mVisibleRegionsDirty = true; mUpdateInputInfo = true; mDrawingState.traverseInZOrder([&](Layer* layer) { if (mLayersPendingRemoval.indexOf(sp<Layer>::fromExisting(layer)) >= 0) { // this layer is not visible anymore Region visibleReg; visibleReg.set(layer->getScreenBounds()); invalidateLayerStack(layer->getOutputFilter(), visibleReg); } }); } if (transactionFlags & eInputInfoUpdateNeeded) { Loading