Bug 1459102 - Back out WR PR 2709 to fix webrender-enabled behaviour on macOS. r=kvark a=Aryx
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 04 May 2018 09:37:48 -0400
changeset 472995 d07a4da682a2f8a2df811d8f0734a5a632213c9b
parent 472994 8994f35fe5fc89f4e8f4e09579a6962f8a4a3e65
child 472996 01ab1ea4c55a27c4d7912e3920c5a373197052a0
child 473067 ef1db4e8bf066e5fcf80a0cd85835fada3a1dbbd
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskvark, Aryx
bugs1459102
milestone61.0a1
first release with
nightly mac
d07a4da682a2 / 61.0a1 / 20180504135935 / files
nightly linux32
nightly linux64
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly mac
Bug 1459102 - Back out WR PR 2709 to fix webrender-enabled behaviour on macOS. r=kvark a=Aryx
gfx/webrender_api/src/display_list.rs
--- a/gfx/webrender_api/src/display_list.rs
+++ b/gfx/webrender_api/src/display_list.rs
@@ -231,56 +231,45 @@ impl<'a> BuiltDisplayListIter<'a> {
         }
 
         // Don't let these bleed into another item
         self.cur_stops = ItemRange::default();
         self.cur_complex_clip = (ItemRange::default(), 0);
         self.cur_clip_chain_items = ItemRange::default();
 
         loop {
-            self.next_raw();
-            if let SetGradientStops = self.cur_item.item {
-                // SetGradientStops is a dummy item that most consumers should ignore
-                continue;
+            if self.data.is_empty() {
+                return None;
             }
-            break;
-        }
 
-        Some(self.as_ref())
-    }
+            {
+                let reader = bincode::IoReader::new(UnsafeReader::new(&mut self.data));
+                bincode::deserialize_in_place(reader, &mut self.cur_item)
+                    .expect("MEH: malicious process?");
+            }
 
-    /// Gets the next display item, even if it's a dummy. Also doesn't handle peeking
-    /// and may leave irrelevant ranges live (so a Clip may have GradientStops if
-    /// for some reason you ask).
-    pub fn next_raw<'b>(&'b mut self) -> Option<DisplayItemRef<'a, 'b>> {
-        use SpecificDisplayItem::*;
+            match self.cur_item.item {
+                SetGradientStops => {
+                    self.cur_stops = skip_slice::<GradientStop>(self.list, &mut self.data).0;
 
-        if self.data.is_empty() {
-            return None;
-        }
-
-        {
-            let reader = bincode::IoReader::new(UnsafeReader::new(&mut self.data));
-            bincode::deserialize_in_place(reader, &mut self.cur_item)
-                .expect("MEH: malicious process?");
-        }
+                    // This is a dummy item, skip over it
+                    continue;
+                }
+                ClipChain(_) => {
+                    self.cur_clip_chain_items = skip_slice::<ClipId>(self.list, &mut self.data).0;
+                }
+                Clip(_) | ScrollFrame(_) => {
+                    self.cur_complex_clip = self.skip_slice::<ComplexClipRegion>()
+                }
+                Text(_) => self.cur_glyphs = self.skip_slice::<GlyphInstance>().0,
+                PushStackingContext(_) => self.cur_filters = self.skip_slice::<FilterOp>().0,
+                _ => { /* do nothing */ }
+            }
 
-        match self.cur_item.item {
-            SetGradientStops => {
-                self.cur_stops = skip_slice::<GradientStop>(self.list, &mut self.data).0;
-            }
-            ClipChain(_) => {
-                self.cur_clip_chain_items = skip_slice::<ClipId>(self.list, &mut self.data).0;
-            }
-            Clip(_) | ScrollFrame(_) => {
-                self.cur_complex_clip = self.skip_slice::<ComplexClipRegion>()
-            }
-            Text(_) => self.cur_glyphs = self.skip_slice::<GlyphInstance>().0,
-            PushStackingContext(_) => self.cur_filters = self.skip_slice::<FilterOp>().0,
-            _ => { /* do nothing */ }
+            break;
         }
 
         Some(self.as_ref())
     }
 
     fn skip_slice<T: for<'de> Deserialize<'de>>(&mut self) -> (ItemRange<T>, usize) {
         skip_slice::<T>(self.list, &mut self.data)
     }
@@ -440,17 +429,17 @@ impl<'a, T: for<'de> Deserialize<'de>> :
 #[cfg(feature = "serialize")]
 impl Serialize for BuiltDisplayList {
     fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
         use display_item::CompletelySpecificDisplayItem::*;
         use display_item::GenericDisplayItem;
 
         let mut seq = serializer.serialize_seq(None)?;
         let mut traversal = self.iter();
-        while let Some(item) = traversal.next_raw() {
+        while let Some(item) = traversal.next() {
             let display_item = item.display_item();
             let serial_di = GenericDisplayItem {
                 item: match display_item.item {
                     SpecificDisplayItem::Clip(v) => Clip(
                         v,
                         item.iter.list.get(item.iter.cur_complex_clip.0).collect()
                     ),
                     SpecificDisplayItem::ClipChain(v) => ClipChain(
@@ -892,17 +881,17 @@ impl DisplayListBuilder {
     }
 
     pub fn print_display_list(&mut self) {
         let mut temp = BuiltDisplayList::default();
         mem::swap(&mut temp.data, &mut self.data);
 
         {
             let mut iter = BuiltDisplayListIter::new(&temp);
-            while let Some(item) = iter.next_raw() {
+            while let Some(item) = iter.next() {
                 println!("{:?}", item.display_item());
             }
         }
 
         self.data = temp.data;
     }
 
     fn push_item(&mut self, item: SpecificDisplayItem, info: &LayoutPrimitiveInfo) {