Skip to content

Commit 71c6434

Browse files
jamienicolweb-flow
authored andcommitted
Bug 1893956 - Disallow underlay compositor surfaces during low-quality pinch zoom. r=gfx-reviewers,nical
Underlay compositor surfaces require a cutout to be rendered to the picture cache tiles above the underlay. During low-quality pinch zoom the screen position of the cutout after the picture cache tiles have been composited may not align exactly with the position of the underlay surface which is composited directly. This can result in visible seams along the edges of video. Additionally, in underlay mode picture tiles still get invalidated during a low quality zoom, which results in worse performance. This patch therefore disallows Underlay compositor surfaces whilst a low-quality pinch zoom is active. Differential Revision: https://phabricator.services.mozilla.com/D222638
1 parent 2915d85 commit 71c6434

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

webrender/src/picture.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1878,6 +1878,7 @@ enum SurfacePromotionFailure {
18781878
UnderlayAlphaBackdrop,
18791879
UnderlaySurfaceLimit,
18801880
UnderlayIntersectsOverlay,
1881+
UnderlayLowQualityZoom,
18811882
NotRootTileCache,
18821883
ComplexTransform,
18831884
SliceAtomic,
@@ -1897,6 +1898,7 @@ impl Display for SurfacePromotionFailure {
18971898
SurfacePromotionFailure::UnderlayAlphaBackdrop => "underlay requires an opaque backdrop",
18981899
SurfacePromotionFailure::UnderlaySurfaceLimit => "hit the underlay surface limit",
18991900
SurfacePromotionFailure::UnderlayIntersectsOverlay => "underlay intersects already-promoted overlay",
1901+
SurfacePromotionFailure::UnderlayLowQualityZoom => "underlay not allowed during low-quality pinch zoom",
19001902
SurfacePromotionFailure::NotRootTileCache => "is not on a root tile cache",
19011903
SurfacePromotionFailure::ComplexTransform => "has a complex transform",
19021904
SurfacePromotionFailure::SliceAtomic => "slice is atomic",
@@ -2559,6 +2561,15 @@ impl TileCacheInstance {
25592561
if self.overlay_region.intersects(&pic_coverage_rect) {
25602562
return Err(UnderlayIntersectsOverlay);
25612563
}
2564+
2565+
// Underlay cutouts are difficult to align with compositor surfaces when
2566+
// compositing during low-quality zoom, and the required invalidation
2567+
// whilst zooming would prevent low-quality zoom from working efficiently.
2568+
if frame_context.config.low_quality_pinch_zoom &&
2569+
frame_context.spatial_tree.get_spatial_node(prim_spatial_node_index).is_ancestor_or_self_zooming
2570+
{
2571+
return Err(UnderlayLowQualityZoom);
2572+
}
25622573
}
25632574
CompositorSurfaceKind::Blit => unreachable!(),
25642575
}

0 commit comments

Comments
 (0)