0

[TreesInViz] Fix tile update tracking for CommitsToActiveTree mode

When LTHI is set to commit to the active tree in LayerContext mode,
we need to use the 'updated_tiles_' tracking mechanism for the Active
tree.

Fixes the LayerTreeMaskLayer tests.

Bug: 404813701
Change-Id: I8964b006c33b75b17fb2eba3d631c045b46c1f9e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6389120
Reviewed-by: Colin Blundell <blundell@chromium.org>
Commit-Queue: Victor Miura <vmiura@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1437806}
This commit is contained in:
Victor Miura
2025-03-25 16:04:05 -07:00
committed by Chromium LUCI CQ
parent 73fbdaf34d
commit d6df698b59
4 changed files with 11 additions and 18 deletions

@ -957,9 +957,10 @@ void PictureLayerImpl::NotifyTileStateChanged(const Tile* tile) {
}
if (layer_tree_impl()->settings().UseLayerContextForDisplay() &&
!IsActive()) {
// Accumulate tile changes on the pending tree only. These are pushed to the
// active tree in PushPropertiesTo().
(!IsActive() || layer_tree_impl()->settings().commit_to_active_tree)) {
// Tiles for the tree currently being committed to (Pending or Active)
// are pushed to the display during UpdateDisplayTree. Accumulate those
// changes. These are pushed to the active tree in PushPropertiesTo().
updated_tiles_[tile->contents_scale_key()].emplace(tile->tiling_i_index(),
tile->tiling_j_index());
}

@ -130,6 +130,7 @@ void FakePictureLayerImpl::SetTileReady(Tile* tile) {
TileDrawInfo& draw_info = tile->draw_info();
draw_info.SetSolidColorForTesting(SkColors::kRed);
DCHECK(draw_info.IsReadyToDraw());
NotifyTileStateChanged(tile);
}
void FakePictureLayerImpl::DidBecomeActive() {

@ -2194,9 +2194,12 @@ void LayerTreeHostImpl::NotifyTileStateChanged(const Tile* tile) {
layer_impl->NotifyTileStateChanged(tile);
if (settings_.UseLayerContextForDisplay() && !is_pending_tree) {
// Pending tree tile updates are pushed to the display tree after
// activation. For active tree tile updates we push immediately.
if (settings_.UseLayerContextForDisplay() && !is_pending_tree &&
!CommitsToActiveTree()) {
// Tiles for the tree currently being committed to (Pending or Active)
// are pushed to the display during UpdateDisplayTree. For active tree,
// if we're not committing to Active, tiles are pushed immediately via
// UpdateDisplayTile.
layer_context_->UpdateDisplayTile(
static_cast<PictureLayerImpl&>(*layer_impl), *tile,
*resource_provider(), *layer_tree_frame_sink_->context_provider());

@ -4,7 +4,6 @@
-LayerTreeHostTestContinuousDrawWhenCreatingVisibleTiles.RunMultiThread_DelegatingRenderer
-LayerTreeHostTestCrispUpAfterPinchEnds.RunMultiThread_DelegatingRenderer
-LayerTreeHostTestDamagePropagatesFromViewTransitionSurface.RunMultiThread_DelegatingRenderer
-LayerTreeTestMaskLayerForSurfaceWithContentRectNotAtOriginWithLayerList.RunMultiThread_DelegatingRenderer
-LayerTreeHostImplTest.BlendingOffWhenDrawingOpaqueLayers/CommitToActiveTree
-LayerTreeHostImplTest.BlendingOffWhenDrawingOpaqueLayers/CommitToPendingTree
-LayerTreeHostImplTest.DamageShouldNotCareAboutContributingLayers/CommitToActiveTree
@ -16,7 +15,6 @@
-LayerTreeHostImplTestDrawAndTestDamage.FrameIncludesDamageRect/CommitToActiveTree
-LayerTreeHostImplTestDrawAndTestDamage.FrameIncludesDamageRect/CommitToPendingTree
-LayerTreeHostPictureTestForceRecalculateScales.RunSingleThread_DelegatingRenderer
-LayerTreeTestMaskLayerForSurfaceWithContentRectNotAtOriginWithLayerList.RunSingleThread_DelegatingRenderer
# These tests rely LayerTreeHostImpl to set certain flags in CompositorFrames
# which it doesn't do in TreesInViz mode.
@ -182,13 +180,3 @@
-LayerTreeHostTestDamageWithScale.RunMultiThread_DelegatingRenderer
-LayerTreeHostTestDamageWithScale.RunSingleThread_DelegatingRenderer
-LayerTreeHostTestSynchronousCompositeSwapPromise.RunSingleThread_DelegatingRenderer
-LayerTreeTestMaskLayerForSurfaceWithClippedLayer.RunMultiThread_DelegatingRenderer
-LayerTreeTestMaskLayerForSurfaceWithClippedLayer.RunSingleThread_DelegatingRenderer
-LayerTreeTestMaskLayerForSurfaceWithContentRectNotAtOrigin.RunMultiThread_DelegatingRenderer
-LayerTreeTestMaskLayerForSurfaceWithContentRectNotAtOrigin.RunSingleThread_DelegatingRenderer
-LayerTreeTestMaskLayerForSurfaceWithDifferentScale.RunMultiThread_DelegatingRenderer
-LayerTreeTestMaskLayerForSurfaceWithDifferentScale.RunSingleThread_DelegatingRenderer
-LayerTreeTestMaskLayerWithScaling.RunMultiThread_DelegatingRenderer
-LayerTreeTestMaskLayerWithScaling.RunSingleThread_DelegatingRenderer
-LayerTreeTestMaskWithNonExactTextureSize.RunMultiThread_DelegatingRenderer
-LayerTreeTestMaskWithNonExactTextureSize.RunSingleThread_DelegatingRenderer