Bug 1507848 - Update webrender to commit 5609676e166f939fcf1a4141c5b9cb715b68f1d9 (WR PR #3315). r=kats
authorWR Updater Bot <graphics-team@mozilla.staktrace.com>
Fri, 16 Nov 2018 20:12:16 +0000
changeset 503267 669cd919724934a05579ed2e561d04dedd11e93a
parent 503266 e58fd91eddcdbdf00c8a1902026c1d4fe0845396
child 503268 d3468dd807eb970c794257cde9f48650bbf7d7bd
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
bugs1507848
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 1507848 - Update webrender to commit 5609676e166f939fcf1a4141c5b9cb715b68f1d9 (WR PR #3315). r=kats Differential Revision: https://phabricator.services.mozilla.com/D12170
gfx/webrender/src/display_list_flattener.rs
gfx/webrender_api/src/display_list.rs
gfx/webrender_bindings/revision.txt
--- a/gfx/webrender/src/display_list_flattener.rs
+++ b/gfx/webrender/src/display_list_flattener.rs
@@ -364,17 +364,17 @@ impl<'a> DisplayListFlattener<'a> {
         // This is useful when calculating scroll extents for the
         // SpatialNode::scroll(..) API as well as for properly setting sticky
         // positioning offsets.
         let frame_rect = item.clip_rect().translate(reference_frame_relative_offset);
         let content_rect = item.rect().translate(reference_frame_relative_offset);
 
         debug_assert!(info.clip_id != info.scroll_frame_id);
 
-        self.add_clip_node(info.clip_id, clip_and_scroll_ids.scroll_node_id, clip_region);
+        self.add_clip_node(info.clip_id, clip_and_scroll_ids, clip_region);
 
         self.add_scroll_frame(
             info.scroll_frame_id,
             info.clip_id,
             info.external_id,
             pipeline_id,
             &frame_rect,
             &content_rect.size,
@@ -383,22 +383,23 @@ impl<'a> DisplayListFlattener<'a> {
     }
 
     fn flatten_reference_frame(
         &mut self,
         traversal: &mut BuiltDisplayListIter<'a>,
         pipeline_id: PipelineId,
         item: &DisplayItemRef,
         reference_frame: &ReferenceFrame,
-        scroll_node_id: ClipId,
+        clip_and_scroll_ids: &ClipAndScrollInfo,
         reference_frame_relative_offset: LayoutVector2D,
     ) {
         self.push_reference_frame(
             reference_frame.id,
-            Some(scroll_node_id),
+            Some(clip_and_scroll_ids.scroll_node_id),
+            clip_and_scroll_ids.clip_node_id,
             pipeline_id,
             reference_frame.transform,
             reference_frame.perspective,
             reference_frame_relative_offset + item.rect().origin.to_vector(),
         );
 
         self.flatten_items(traversal, pipeline_id, LayoutVector2D::zero());
     }
@@ -459,32 +460,32 @@ impl<'a> DisplayListFlattener<'a> {
         let pipeline = match self.scene.pipelines.get(&iframe_pipeline_id) {
             Some(pipeline) => pipeline,
             None => {
                 debug_assert!(info.ignore_missing_pipeline);
                 return
             },
         };
 
-        //TODO: use or assert on `clip_and_scroll_ids.clip_node_id` ?
         let clip_chain_index = self.add_clip_node(
             info.clip_id,
-            clip_and_scroll_ids.scroll_node_id,
+            clip_and_scroll_ids,
             ClipRegion::create_for_clip_node_with_local_clip(
                 item.clip_rect(),
                 reference_frame_relative_offset
             ),
         );
         self.pipeline_clip_chain_stack.push(clip_chain_index);
 
         let bounds = item.rect();
         let origin = *reference_frame_relative_offset + bounds.origin.to_vector();
         self.push_reference_frame(
             ClipId::root_reference_frame(iframe_pipeline_id),
             Some(info.clip_id),
+            None,
             iframe_pipeline_id,
             None,
             None,
             origin,
         );
 
         let iframe_rect = LayoutRect::new(LayoutPoint::zero(), bounds.size);
         self.add_scroll_frame(
@@ -642,17 +643,17 @@ impl<'a> DisplayListFlattener<'a> {
             }
             SpecificDisplayItem::PushReferenceFrame(ref info) => {
                 let mut subtraversal = item.sub_iter();
                 self.flatten_reference_frame(
                     &mut subtraversal,
                     pipeline_id,
                     &item,
                     &info.reference_frame,
-                    clip_and_scroll_ids.scroll_node_id,
+                    &clip_and_scroll_ids,
                     reference_frame_relative_offset,
                 );
                 return Some(subtraversal);
 
             }
             SpecificDisplayItem::Iframe(ref info) => {
                 self.flatten_iframe(
                     &item,
@@ -664,17 +665,17 @@ impl<'a> DisplayListFlattener<'a> {
             SpecificDisplayItem::Clip(ref info) => {
                 let complex_clips = self.get_complex_clips(pipeline_id, item.complex_clip().0);
                 let clip_region = ClipRegion::create_for_clip_node(
                     *item.clip_rect(),
                     complex_clips,
                     info.image_mask,
                     &reference_frame_relative_offset,
                 );
-                self.add_clip_node(info.id, clip_and_scroll_ids.scroll_node_id, clip_region);
+                self.add_clip_node(info.id, &clip_and_scroll_ids, clip_region);
             }
             SpecificDisplayItem::ClipChain(ref info) => {
                 // For a user defined clip-chain the parent (if specified) must
                 // refer to another user defined clip-chain. If none is specified,
                 // the parent is the root clip-chain for the given pipeline. This
                 // is used to provide a root clip chain for iframes.
                 let mut parent_clip_chain_id = match info.parent {
                     Some(id) => {
@@ -1288,33 +1289,34 @@ impl<'a> DisplayListFlattener<'a> {
             self.pending_shadow_items.is_empty(),
             "Found unpopped shadows when popping stacking context!"
         );
     }
 
     pub fn push_reference_frame(
         &mut self,
         reference_frame_id: ClipId,
-        parent_id: Option<ClipId>,
+        parent_scroll_id: Option<ClipId>,
+        parent_clip_id: Option<ClipId>,
         pipeline_id: PipelineId,
         source_transform: Option<PropertyBinding<LayoutTransform>>,
         source_perspective: Option<LayoutTransform>,
         origin_in_parent_reference_frame: LayoutVector2D,
     ) -> SpatialNodeIndex {
-        let parent_index = parent_id.map(|id| self.id_to_index_mapper.get_spatial_node_index(id));
+        let parent_index = parent_scroll_id.map(|id| self.id_to_index_mapper.get_spatial_node_index(id));
         let index = self.clip_scroll_tree.add_reference_frame(
             parent_index,
             source_transform,
             source_perspective,
             origin_in_parent_reference_frame,
             pipeline_id,
         );
         self.id_to_index_mapper.map_spatial_node(reference_frame_id, index);
 
-        match parent_id {
+        match parent_clip_id.or(parent_scroll_id) {
             Some(ref parent_id) =>
                 self.id_to_index_mapper.map_to_parent_clip_chain(reference_frame_id, parent_id),
             _ => self.id_to_index_mapper.add_clip_chain(reference_frame_id, ClipChainId::NONE, 0),
         }
         index
     }
 
     pub fn push_root(
@@ -1326,16 +1328,17 @@ impl<'a> DisplayListFlattener<'a> {
         if let ChasePrimitive::Id(id) = self.config.chase_primitive {
             println!("Chasing {:?} by index", id);
             register_prim_chase_id(id);
         }
 
         self.push_reference_frame(
             ClipId::root_reference_frame(pipeline_id),
             None,
+            None,
             pipeline_id,
             None,
             None,
             LayoutVector2D::zero(),
         );
 
         self.add_scroll_frame(
             ClipId::root_scroll_node(pipeline_id),
@@ -1346,31 +1349,31 @@ impl<'a> DisplayListFlattener<'a> {
             content_size,
             ScrollSensitivity::ScriptAndInputEvents,
         );
     }
 
     pub fn add_clip_node<I>(
         &mut self,
         new_node_id: ClipId,
-        parent_id: ClipId,
+        parent: &ClipAndScrollInfo,
         clip_region: ClipRegion<I>,
     ) -> ClipChainId
     where
         I: IntoIterator<Item = ComplexClipRegion>
     {
         // Add a new ClipNode - this is a ClipId that identifies a list of clip items,
         // and the positioning node associated with those clip sources.
 
         // Map from parent ClipId to existing clip-chain.
         let mut parent_clip_chain_index = self
             .id_to_index_mapper
-            .get_clip_chain_id(&parent_id);
+            .get_clip_chain_id(&parent.clip_node_id());
         // Map the ClipId for the positioning node to a spatial node index.
-        let spatial_node = self.id_to_index_mapper.get_spatial_node_index(parent_id);
+        let spatial_node = self.id_to_index_mapper.get_spatial_node_index(parent.scroll_node_id);
 
         // Add a mapping for this ClipId in case it's referenced as a positioning node.
         self.id_to_index_mapper
             .map_spatial_node(new_node_id, spatial_node);
 
         let mut clip_count = 0;
 
         // Intern each clip item in this clip node, and add the interned
--- a/gfx/webrender_api/src/display_list.rs
+++ b/gfx/webrender_api/src/display_list.rs
@@ -1409,58 +1409,75 @@ impl DisplayListBuilder {
         clip_rect: LayoutRect,
         complex_clips: I,
         image_mask: Option<ImageMask>,
     ) -> ClipId
     where
         I: IntoIterator<Item = ComplexClipRegion>,
         I::IntoIter: ExactSizeIterator + Clone,
     {
-        let parent = self.clip_stack.last().unwrap().scroll_node_id;
-        self.define_clip_with_parent(
-            parent,
+        let clip_and_scroll = self.clip_stack.last().unwrap().clone();
+        self.define_clip_impl(
+            clip_and_scroll,
             clip_rect,
             complex_clips,
-            image_mask
+            image_mask,
         )
     }
 
     pub fn define_clip_with_parent<I>(
         &mut self,
         parent: ClipId,
         clip_rect: LayoutRect,
         complex_clips: I,
         image_mask: Option<ImageMask>,
     ) -> ClipId
     where
         I: IntoIterator<Item = ComplexClipRegion>,
         I::IntoIter: ExactSizeIterator + Clone,
     {
+        self.define_clip_impl(
+            ClipAndScrollInfo::simple(parent),
+            clip_rect,
+            complex_clips,
+            image_mask,
+        )
+    }
+
+    fn define_clip_impl<I>(
+        &mut self,
+        scrollinfo: ClipAndScrollInfo,
+        clip_rect: LayoutRect,
+        complex_clips: I,
+        image_mask: Option<ImageMask>,
+    ) -> ClipId
+    where
+        I: IntoIterator<Item = ComplexClipRegion>,
+        I::IntoIter: ExactSizeIterator + Clone,
+    {
         let id = self.generate_clip_index();
         let item = SpecificDisplayItem::Clip(ClipDisplayItem {
             id,
             image_mask,
         });
 
         let info = LayoutPrimitiveInfo::new(clip_rect);
 
-        let scrollinfo = ClipAndScrollInfo::simple(parent);
         self.push_item_with_clip_scroll_info(item, &info, scrollinfo);
         self.push_iter(complex_clips);
         id
     }
 
     pub fn define_sticky_frame(
         &mut self,
         frame_rect: LayoutRect,
         margins: SideOffsets2D<Option<f32>>,
         vertical_offset_bounds: StickyOffsetBounds,
         horizontal_offset_bounds: StickyOffsetBounds,
         previously_applied_offset: LayoutVector2D,
-
     ) -> ClipId {
         let id = self.generate_spatial_index();
         let item = SpecificDisplayItem::StickyFrame(StickyFrameDisplayItem {
             id,
             margins,
             vertical_offset_bounds,
             horizontal_offset_bounds,
             previously_applied_offset,
--- a/gfx/webrender_bindings/revision.txt
+++ b/gfx/webrender_bindings/revision.txt
@@ -1,1 +1,1 @@
-dc442bfe38dcd9fc5033d2191b04c6242d167f05
+5609676e166f939fcf1a4141c5b9cb715b68f1d9