Bug 1502717 - Cherry pick webrender commit 7f889ccf165ef0bcbf3688ccb1c51bddd84a7b6f (WR PR #3316). r=kats
authorWR Updater Bot <graphics-team@mozilla.staktrace.com>
Fri, 16 Nov 2018 11:39:10 +0000
changeset 503177 0f0b77b3d36e7aba4cf33d46f549750a362173c1
parent 503176 294c7b9011c0a5657ea384d1328805ff48e60f43
child 503178 112ed7029b78bdeaec3a6a9956cb44460ff7caa1
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1502717
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1502717 - Cherry pick webrender commit 7f889ccf165ef0bcbf3688ccb1c51bddd84a7b6f (WR PR #3316). r=kats Differential Revision: https://phabricator.services.mozilla.com/D12107
gfx/webrender/src/spatial_node.rs
gfx/webrender_bindings/revision.txt
--- a/gfx/webrender/src/spatial_node.rs
+++ b/gfx/webrender/src/spatial_node.rs
@@ -268,46 +268,48 @@ impl SpatialNode {
                     .post_translate(state.parent_accumulated_scroll_offset)
                     .to_transform()
                     .with_destination::<LayoutPixel>();
                 self.world_viewport_transform =
                     state.parent_reference_frame_transform.pre_mul(&relative_transform.into());
                 self.world_content_transform = self.world_viewport_transform;
 
                 info.invertible = self.world_viewport_transform.is_invertible();
-                if !info.invertible {
-                    return;
-                }
 
-                // Try to update our compatible coordinate system transform. If we cannot, start a new
-                // incompatible coordinate system.
-                match ScaleOffset::from_transform(&relative_transform) {
-                    Some(ref scale_offset) => {
-                        self.coordinate_system_relative_scale_offset =
-                            state.coordinate_system_relative_scale_offset.accumulate(scale_offset);
-                    }
-                    None => {
-                        // If we break 2D axis alignment or have a perspective component, we need to start a
-                        // new incompatible coordinate system with which we cannot share clips without masking.
-                        self.coordinate_system_relative_scale_offset = ScaleOffset::identity();
+                if info.invertible {
+                    // Try to update our compatible coordinate system transform. If we cannot, start a new
+                    // incompatible coordinate system.
+                    match ScaleOffset::from_transform(&relative_transform) {
+                        Some(ref scale_offset) => {
+                            self.coordinate_system_relative_scale_offset =
+                                state.coordinate_system_relative_scale_offset.accumulate(scale_offset);
+                        }
+                        None => {
+                            // If we break 2D axis alignment or have a perspective component, we need to start a
+                            // new incompatible coordinate system with which we cannot share clips without masking.
+                            self.coordinate_system_relative_scale_offset = ScaleOffset::identity();
 
-                        let transform = state.coordinate_system_relative_scale_offset
-                                             .to_transform()
-                                             .pre_mul(&relative_transform);
+                            let transform = state.coordinate_system_relative_scale_offset
+                                                 .to_transform()
+                                                 .pre_mul(&relative_transform);
 
-                        // Push that new coordinate system and record the new id.
-                        let coord_system = CoordinateSystem {
-                            transform,
-                            parent: Some(state.current_coordinate_system_id),
-                        };
-                        state.current_coordinate_system_id = CoordinateSystemId(coord_systems.len() as u32);
-                        coord_systems.push(coord_system);
+                            // Push that new coordinate system and record the new id.
+                            let coord_system = CoordinateSystem {
+                                transform,
+                                parent: Some(state.current_coordinate_system_id),
+                            };
+                            state.current_coordinate_system_id = CoordinateSystemId(coord_systems.len() as u32);
+                            coord_systems.push(coord_system);
+                        }
                     }
                 }
 
+                // Ensure that the current coordinate system ID is propagated to child
+                // nodes, even if we encounter a node that is not invertible. This ensures
+                // that the invariant in get_relative_transform is not violated.
                 self.coordinate_system_id = state.current_coordinate_system_id;
             }
             _ => {
                 // We calculate this here to avoid a double-borrow later.
                 let sticky_offset = self.calculate_sticky_offset(
                     &state.nearest_scrolling_ancestor_offset,
                     &state.nearest_scrolling_ancestor_viewport,
                 );
--- a/gfx/webrender_bindings/revision.txt
+++ b/gfx/webrender_bindings/revision.txt
@@ -1,1 +1,2 @@
 02387f7e5c77c415cfa232366c321d6f621cae28
+plus servo/webrender#3316 cherry-picked