Commit 98f66bac authored by Alexandru Marc's avatar Alexandru Marc Committed by amarc@mozilla.com
Browse files

Revert "Bug 1970784 - Prevent full render when tile size is changed...

Revert "Bug 1970784 - Prevent full render when tile size is changed r=gfx-reviewers,nical" for causing Linux rendering regressions

This reverts commit fa583399.
parent 0a6ef1b2
Loading
Loading
Loading
Loading
+8 −11
Original line number Diff line number Diff line
@@ -513,6 +513,9 @@ struct TileUpdateDirtyState<'a> {
    /// Allow access to the texture cache for requesting tiles
    resource_cache: &'a mut ResourceCache,

    /// Current configuration and setup for compositing all the picture cache tiles in renderer.
    composite_state: &'a mut CompositeState,

    /// A cache of comparison results to avoid re-computation during invalidation.
    compare_cache: &'a mut FastHashMap<PrimitiveComparisonKey, PrimitiveCompareResult>,

@@ -921,9 +924,8 @@ impl Tile {
        // TODO(gw): We can avoid invalidating the whole tile in some cases here,
        //           but it should be a fairly rare invalidation case.
        if self.current_descriptor.local_valid_rect != self.prev_descriptor.local_valid_rect {
            let dirty_rect = self.current_descriptor.local_valid_rect
                .union(&self.prev_descriptor.local_valid_rect);
            self.invalidate(Some(dirty_rect), InvalidationReason::ValidRectChanged);
            self.invalidate(None, InvalidationReason::ValidRectChanged);
            state.composite_state.dirty_rects_are_valid = false;
        }
    }

@@ -3934,6 +3936,7 @@ impl TileCacheInstance {

        let mut state = TileUpdateDirtyState {
            resource_cache,
            composite_state,
            compare_cache: &mut self.compare_cache,
            spatial_node_comparer: &mut self.spatial_node_comparer,
        };
@@ -5378,15 +5381,9 @@ impl PicturePrimitive {

                for (sub_slice_index, sub_slice) in tile_cache.sub_slices.iter_mut().enumerate() {
                    for tile in sub_slice.tiles.values_mut() {
                        let max_dirty_rect = if tile.current_descriptor.local_valid_rect != tile.prev_descriptor.local_valid_rect {
                            tile.current_descriptor.local_valid_rect
                                .union(&tile.prev_descriptor.local_valid_rect)
                        } else {
                            tile.current_descriptor.local_valid_rect
                        };
                        // Ensure that the dirty rect doesn't extend outside the local valid rect.
                        tile.local_dirty_rect = tile.local_dirty_rect
                            .intersection(&max_dirty_rect)
                            .intersection(&tile.current_descriptor.local_valid_rect)
                            .unwrap_or_else(|| { tile.is_valid = true; PictureRect::zero() });

                        let valid_rect = frame_state.composite_state.get_surface_rect(
@@ -5517,7 +5514,7 @@ impl PicturePrimitive {
                        // Ensure - again - that the dirty rect doesn't extend outside the local valid rect,
                        // as the tile could have been invalidated since the first computation.
                        tile.local_dirty_rect = tile.local_dirty_rect
                            .intersection(&max_dirty_rect)
                            .intersection(&tile.current_descriptor.local_valid_rect)
                            .unwrap_or_else(|| { tile.is_valid = true; PictureRect::zero() });

                        surface_local_dirty_rect = surface_local_dirty_rect.union(&tile.local_dirty_rect);
+1 −1
Original line number Diff line number Diff line
@@ -55,6 +55,6 @@ skip_on(android) == raster-root-scaling-2.yaml raster-root-scaling-2-ref.yaml
!= raster-root-huge-scale.yaml blank.yaml
!= non-inversible-world-rect.yaml blank.yaml
== nested-local-scale.yaml nested-local-scale-ref.yaml
platform(linux,mac) fuzzy(1,6) == perspective-surface-scale.yaml perspective-surface-scale.png
platform(linux,mac) == perspective-surface-scale.yaml perspective-surface-scale.png
fuzzy(1,8762) == computed-rotation-yflip.yaml computed-rotation-yflip.png
fuzzy(5,100) fuzzy-if(platform(win),1,201) == corner-scale.yaml corner-scale-2.yaml
+6 −6
Original line number Diff line number Diff line
@@ -85,9 +85,9 @@ impl<'a> TestHarness<'a> {
            tile_info.local_valid_rect,
            pr(100.0, 100.0, 100.0, 100.0),
        );
        assert!(
            tile_info.local_dirty_rect.contains_box(
                &pr(100.0, 100.0, 100.0, 100.0))
        assert_eq!(
            tile_info.local_dirty_rect,
            pr(100.0, 100.0, 100.0, 100.0),
        );

        // Render composite_nop_2.yaml, ensure that the valid/dirty rects are as expected
@@ -97,9 +97,9 @@ impl<'a> TestHarness<'a> {
            tile_info.local_valid_rect,
            pr(100.0, 120.0, 100.0, 100.0),
        );
        assert!(
            tile_info.local_dirty_rect.contains_box(
                &pr(100.0, 120.0, 100.0, 100.0))
        assert_eq!(
            tile_info.local_dirty_rect,
            pr(100.0, 120.0, 100.0, 100.0),
        );

        // Main part of this test - ensure WR detects a composite is required in this case