Loading services/surfaceflinger/FrontEnd/LayerSnapshot.cpp +2 −3 Original line number Diff line number Diff line Loading @@ -345,10 +345,9 @@ void LayerSnapshot::merge(const RequestedLayerState& requested, bool forceUpdate clientChanges = requested.what; changes = requested.changes; contentDirty = requested.what & layer_state_t::CONTENT_DIRTY; // TODO(b/238781169) scope down the changes to only buffer updates. hasReadyFrame = requested.hasReadyFrame(); hasReadyFrame = requested.autoRefresh; sidebandStreamHasFrame = requested.hasSidebandStreamFrame(); updateSurfaceDamage(requested, hasReadyFrame, forceFullDamage, surfaceDamage); updateSurfaceDamage(requested, requested.hasReadyFrame(), forceFullDamage, surfaceDamage); if (forceUpdate || requested.what & layer_state_t::eTransparentRegionChanged) { transparentRegionHint = requested.transparentRegion; Loading services/surfaceflinger/FrontEnd/LayerSnapshot.h +1 −1 Original line number Diff line number Diff line Loading @@ -79,7 +79,7 @@ struct LayerSnapshot : public compositionengine::LayerFECompositionState { std::shared_ptr<renderengine::ExternalTexture> externalTexture; gui::LayerMetadata layerMetadata; gui::LayerMetadata relativeLayerMetadata; bool hasReadyFrame; bool hasReadyFrame; // used in post composition to check if there is another frame ready ui::Transform localTransformInverse; gui::WindowInfo inputInfo; ui::Transform localTransform; Loading services/surfaceflinger/SurfaceFlinger.cpp +11 −9 Original line number Diff line number Diff line Loading @@ -2359,19 +2359,20 @@ bool SurfaceFlinger::updateLayerSnapshots(VsyncId vsyncId, nsecs_t frameTimeNs, mLayersWithBuffersRemoved.emplace(it->second); } it->second->latchBufferImpl(unused, latchTime, bgColorOnly); newDataLatched = true; mLayersWithQueuedFrames.emplace(it->second); mLayersIdsWithQueuedFrames.emplace(it->second->sequence); } for (auto& snapshot : mLayerSnapshotBuilder.getSnapshots()) { updateLayerHistory(*snapshot); if (!snapshot->hasReadyFrame) continue; newDataLatched = true; if (!snapshot->isVisible) break; mLayerSnapshotBuilder.forEachVisibleSnapshot([&](const frontend::LayerSnapshot& snapshot) { updateLayerHistory(snapshot); if (mLayersIdsWithQueuedFrames.find(snapshot.path.id) == mLayersIdsWithQueuedFrames.end()) return; Region visibleReg; visibleReg.set(snapshot->transformedBoundsWithoutTransparentRegion); invalidateLayerStack(snapshot->outputFilter, visibleReg); } visibleReg.set(snapshot.transformedBoundsWithoutTransparentRegion); invalidateLayerStack(snapshot.outputFilter, visibleReg); }); for (auto& destroyedLayer : mLayerLifecycleManager.getDestroyedLayers()) { mLegacyLayers.erase(destroyedLayer->id); Loading Loading @@ -2741,6 +2742,7 @@ CompositeResultsPerDisplay SurfaceFlinger::composite( mScheduler->modulateVsync({}, &VsyncModulator::onDisplayRefresh, hasGpuUseOrReuse); mLayersWithQueuedFrames.clear(); mLayersIdsWithQueuedFrames.clear(); if (mLayerTracingEnabled && mLayerTracing.flagIsSet(LayerTracing::TRACE_COMPOSITION)) { // This will block and should only be used for debugging. addToLayerTracing(mVisibleRegionsDirty, pacesetterTarget.frameBeginTime(), vsyncId); Loading services/surfaceflinger/SurfaceFlinger.h +2 −0 Original line number Diff line number Diff line Loading @@ -1207,6 +1207,8 @@ private: // latched. std::unordered_set<sp<Layer>, SpHash<Layer>> mLayersWithQueuedFrames; std::unordered_set<sp<Layer>, SpHash<Layer>> mLayersWithBuffersRemoved; std::unordered_set<uint32_t> mLayersIdsWithQueuedFrames; // Tracks layers that need to update a display's dirty region. std::vector<sp<Layer>> mLayersPendingRefresh; // Sorted list of layers that were composed during previous frame. This is used to Loading Loading
services/surfaceflinger/FrontEnd/LayerSnapshot.cpp +2 −3 Original line number Diff line number Diff line Loading @@ -345,10 +345,9 @@ void LayerSnapshot::merge(const RequestedLayerState& requested, bool forceUpdate clientChanges = requested.what; changes = requested.changes; contentDirty = requested.what & layer_state_t::CONTENT_DIRTY; // TODO(b/238781169) scope down the changes to only buffer updates. hasReadyFrame = requested.hasReadyFrame(); hasReadyFrame = requested.autoRefresh; sidebandStreamHasFrame = requested.hasSidebandStreamFrame(); updateSurfaceDamage(requested, hasReadyFrame, forceFullDamage, surfaceDamage); updateSurfaceDamage(requested, requested.hasReadyFrame(), forceFullDamage, surfaceDamage); if (forceUpdate || requested.what & layer_state_t::eTransparentRegionChanged) { transparentRegionHint = requested.transparentRegion; Loading
services/surfaceflinger/FrontEnd/LayerSnapshot.h +1 −1 Original line number Diff line number Diff line Loading @@ -79,7 +79,7 @@ struct LayerSnapshot : public compositionengine::LayerFECompositionState { std::shared_ptr<renderengine::ExternalTexture> externalTexture; gui::LayerMetadata layerMetadata; gui::LayerMetadata relativeLayerMetadata; bool hasReadyFrame; bool hasReadyFrame; // used in post composition to check if there is another frame ready ui::Transform localTransformInverse; gui::WindowInfo inputInfo; ui::Transform localTransform; Loading
services/surfaceflinger/SurfaceFlinger.cpp +11 −9 Original line number Diff line number Diff line Loading @@ -2359,19 +2359,20 @@ bool SurfaceFlinger::updateLayerSnapshots(VsyncId vsyncId, nsecs_t frameTimeNs, mLayersWithBuffersRemoved.emplace(it->second); } it->second->latchBufferImpl(unused, latchTime, bgColorOnly); newDataLatched = true; mLayersWithQueuedFrames.emplace(it->second); mLayersIdsWithQueuedFrames.emplace(it->second->sequence); } for (auto& snapshot : mLayerSnapshotBuilder.getSnapshots()) { updateLayerHistory(*snapshot); if (!snapshot->hasReadyFrame) continue; newDataLatched = true; if (!snapshot->isVisible) break; mLayerSnapshotBuilder.forEachVisibleSnapshot([&](const frontend::LayerSnapshot& snapshot) { updateLayerHistory(snapshot); if (mLayersIdsWithQueuedFrames.find(snapshot.path.id) == mLayersIdsWithQueuedFrames.end()) return; Region visibleReg; visibleReg.set(snapshot->transformedBoundsWithoutTransparentRegion); invalidateLayerStack(snapshot->outputFilter, visibleReg); } visibleReg.set(snapshot.transformedBoundsWithoutTransparentRegion); invalidateLayerStack(snapshot.outputFilter, visibleReg); }); for (auto& destroyedLayer : mLayerLifecycleManager.getDestroyedLayers()) { mLegacyLayers.erase(destroyedLayer->id); Loading Loading @@ -2741,6 +2742,7 @@ CompositeResultsPerDisplay SurfaceFlinger::composite( mScheduler->modulateVsync({}, &VsyncModulator::onDisplayRefresh, hasGpuUseOrReuse); mLayersWithQueuedFrames.clear(); mLayersIdsWithQueuedFrames.clear(); if (mLayerTracingEnabled && mLayerTracing.flagIsSet(LayerTracing::TRACE_COMPOSITION)) { // This will block and should only be used for debugging. addToLayerTracing(mVisibleRegionsDirty, pacesetterTarget.frameBeginTime(), vsyncId); Loading
services/surfaceflinger/SurfaceFlinger.h +2 −0 Original line number Diff line number Diff line Loading @@ -1207,6 +1207,8 @@ private: // latched. std::unordered_set<sp<Layer>, SpHash<Layer>> mLayersWithQueuedFrames; std::unordered_set<sp<Layer>, SpHash<Layer>> mLayersWithBuffersRemoved; std::unordered_set<uint32_t> mLayersIdsWithQueuedFrames; // Tracks layers that need to update a display's dirty region. std::vector<sp<Layer>> mLayersPendingRefresh; // Sorted list of layers that were composed during previous frame. This is used to Loading