Skip to content

Instantly share code, notes, and snippets.

@Gankra
Created September 11, 2018 02:37
Show Gist options
  • Save Gankra/ce2fe864282b3112cb918edc4a4e47bf to your computer and use it in GitHub Desktop.
Save Gankra/ce2fe864282b3112cb918edc4a4e47bf to your computer and use it in GitHub Desktop.
diff --git a/gfx/webrender/src/display_list_flattener.rs b/gfx/webrender/src/display_list_flattener.rs
index 525e79e837e2..3498892e1139 100644
--- a/gfx/webrender/src/display_list_flattener.rs
+++ b/gfx/webrender/src/display_list_flattener.rs
@@ -1029,6 +1029,15 @@ impl<'a> DisplayListFlattener<'a> {
None
};
+ let mut ancestor_is_backface_visible = is_backface_visible;
+ for sc in self.sc_stack.iter().rev() {
+ if sc.transform_style == TransformStyle::Flat {
+ ancestor_is_backface_visible = sc.is_backface_visible;
+ break;
+ }
+ }
+
+
let mut parent_prim_index = if !establishes_3d_context && participating_in_3d_context {
// If we're in a 3D context, we will parent the picture
// to the first stacking context we find that is a
@@ -1162,6 +1171,8 @@ impl<'a> DisplayListFlattener<'a> {
// Add this as the top-most picture for primitives to be added to.
self.picture_stack.push(sc_prim_index);
+ let is_backface_visible = is_backface_visible && ancestor_is_backface_visible;
+
// Push the SC onto the stack, so we know how to handle things in
// pop_stacking_context.
let sc = FlattenedStackingContext {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment