Skip to content

Commit

Permalink
Ensure that coord system id is propagated for non-invertible nodes.
Browse files Browse the repository at this point in the history
When a spatial node is encountered that has an invalid matrix, we
need to ensure that the coord system ID is always propagated. This
avoids array indexing errors that can occur during calls to
get_relative_transform.

This fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1507323.
  • Loading branch information
gw3583 committed Nov 20, 2018
1 parent 6ffc7cf commit 899a61b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions webrender/src/spatial_node.rs
Expand Up @@ -191,8 +191,12 @@ impl SpatialNode {
true
}

pub fn mark_uninvertible(&mut self) {
pub fn mark_uninvertible(
&mut self,
state: &mut TransformUpdateState,
) {
self.invertible = false;
self.coordinate_system_id = state.current_coordinate_system_id;
self.world_content_transform = LayoutToWorldFastTransform::identity();
self.world_viewport_transform = LayoutToWorldFastTransform::identity();
}
Expand Down Expand Up @@ -221,7 +225,7 @@ impl SpatialNode {
// If any of our parents was not rendered, we are not rendered either and can just
// quit here.
if !state.invertible {
self.mark_uninvertible();
self.mark_uninvertible(state);
return;
}

Expand All @@ -233,7 +237,7 @@ impl SpatialNode {
// translations which should be invertible.
match self.node_type {
SpatialNodeType::ReferenceFrame(info) if !info.invertible => {
self.mark_uninvertible();
self.mark_uninvertible(state);
return;
}
_ => self.invertible = true,
Expand Down

0 comments on commit 899a61b

Please sign in to comment.