Backed out 8 changesets (bug 1607697) for Build bustages. CLOSED TREE
authorDorel Luca <dluca@mozilla.com>
Wed, 08 Jan 2020 18:04:19 +0200
changeset 509373 c2dd65b196d31e375f8dd4b1ac91e955847ac3c7
parent 509372 d06b9bcc5d278e7c2e4edf90d81dbe451f5b8388
child 509374 27ee0ff923a9c79b87d53e5742e54edb5b5bb06a
push id36995
push userapavel@mozilla.com
push dateWed, 08 Jan 2020 21:56:06 +0000
treeherdermozilla-central@374a48ce8690 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1607697
milestone74.0a1
backs outa3942fa2644c5881a4d92770f0850229c3996fc8
6bf3305bb6893affecdbde816a7bf856a7ed13f1
3af5a9700d47aedf0db0457d86046b6bda1c178b
6101f5e31e46f6c77198c66e14a56ea2510e7c92
d70cc2bb33f62aab04ee8a5ae5a086bcee5ab974
8490fa04e0eec09cbbd6c7b3301af05592d6fd6f
6c1778a36720e182351c6f24666f04e5a481f98b
9e830c9157aebe7303a59f4604889b79352bb709
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
Backed out 8 changesets (bug 1607697) for Build bustages. CLOSED TREE Backed out changeset a3942fa2644c (bug 1607697) Backed out changeset 6bf3305bb689 (bug 1607697) Backed out changeset 3af5a9700d47 (bug 1607697) Backed out changeset 6101f5e31e46 (bug 1607697) Backed out changeset d70cc2bb33f6 (bug 1607697) Backed out changeset 8490fa04e0ee (bug 1607697) Backed out changeset 6c1778a36720 (bug 1607697) Backed out changeset 9e830c9157ae (bug 1607697)
gfx/wr/webrender/src/debug_colors.rs
gfx/wr/webrender/src/filterdata.rs
gfx/wr/webrender/src/image.rs
gfx/wr/webrender/src/lib.rs
gfx/wr/webrender/src/picture.rs
gfx/wr/webrender/src/platform/unix/font.rs
gfx/wr/webrender/src/platform/windows/font.rs
gfx/wr/webrender/src/prim_store/mod.rs
gfx/wr/webrender/src/profiler.rs
gfx/wr/webrender/src/render_backend.rs
gfx/wr/webrender/src/render_task.rs
gfx/wr/webrender/src/renderer.rs
gfx/wr/webrender/src/resource_cache.rs
gfx/wr/webrender/src/scene_builder_thread.rs
gfx/wr/webrender/src/scene_building.rs
gfx/wr/webrender/src/spatial_node.rs
gfx/wr/webrender/src/storage.rs
gfx/wr/webrender/src/texture_cache.rs
gfx/wr/webrender_api/src/api.rs
gfx/wr/webrender_api/src/color.rs
gfx/wr/webrender_api/src/display_item.rs
gfx/wr/webrender_api/src/display_list.rs
gfx/wr/webrender_api/src/font.rs
gfx/wr/webrender_api/src/image.rs
gfx/wr/webrender_api/src/lib.rs
--- a/gfx/wr/webrender/src/debug_colors.rs
+++ b/gfx/wr/webrender/src/debug_colors.rs
@@ -1,14 +1,13 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #![allow(dead_code)]
-#![cfg_attr(feature = "cargo-clippy", allow(clippy::excessive_precision))]
 
 use api::ColorF;
 
 // A subset of the standard CSS colors, useful for defining GPU tag colors etc.
 
 pub const INDIGO: ColorF = ColorF { r: 0.294117647059, g: 0.0, b: 0.509803921569, a: 1.0 };
 pub const GOLD: ColorF = ColorF { r: 1.0, g: 0.843137254902, b: 0.0, a: 1.0 };
 pub const FIREBRICK: ColorF = ColorF { r: 0.698039215686, g: 0.133333333333, b: 0.133333333333, a: 1.0 };
--- a/gfx/wr/webrender/src/filterdata.rs
+++ b/gfx/wr/webrender/src/filterdata.rs
@@ -160,17 +160,17 @@ impl intern::Internable for FilterDataIn
     type InternData = ();
 }
 
 fn push_component_transfer_data(
     func_comp: &SFilterDataComponent,
     request: &mut GpuDataRequest,
 ) {
     match func_comp {
-        SFilterDataComponent::Identity => {}
+        SFilterDataComponent::Identity => { return; }
         SFilterDataComponent::Table(values) |
         SFilterDataComponent::Discrete(values) => {
             // Push a 256 entry lookup table.
             assert!(values.len() > 0);
             for i in 0 .. 64 {
                 let mut arr = [0.0 ; 4];
                 for j in 0 .. 4 {
                     if (values.len() == 1) || (i == 63 && j == 3) {
--- a/gfx/wr/webrender/src/image.rs
+++ b/gfx/wr/webrender/src/image.rs
@@ -595,17 +595,17 @@ pub fn compute_valid_tiles_if_bounds_cha
     tile_size: u16,
 ) -> Option<TileRange> {
     let intersection = prev_rect.intersection(new_rect);
 
     if intersection.is_none() {
         return Some(TileRange::zero());
     }
 
-    let intersection = intersection.unwrap_or_else(DeviceIntRect::zero);
+    let intersection = intersection.unwrap_or(DeviceIntRect::zero());
 
     let left = prev_rect.min_x() != new_rect.min_x();
     let right = prev_rect.max_x() != new_rect.max_x();
     let top = prev_rect.min_y() != new_rect.min_y();
     let bottom = prev_rect.max_y() != new_rect.max_y();
 
     if !left && !right && !top && !bottom {
         // Bounds have not changed.
--- a/gfx/wr/webrender/src/lib.rs
+++ b/gfx/wr/webrender/src/lib.rs
@@ -36,19 +36,16 @@ More information about [stacking context
 [`BuiltDisplayList`](api::BuiltDisplayList)s. These are obtained by finalizing a
 [`DisplayListBuilder`](api::DisplayListBuilder). These are used to draw your geometry. But it
 doesn't only contain trivial geometry, it can also store another
 [`StackingContext`](api::StackingContext), as they're nestable.
 
 [stacking_contexts]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context
 */
 
-#![cfg_attr(feature = "cargo-clippy", allow(clippy::unreadable_literal, clippy::new_without_default, clippy::too_many_arguments))]
-
-
 // Cribbed from the |matches| crate, for simplicity.
 macro_rules! matches {
     ($expression:expr, $($pattern:tt)+) => {
         match $expression {
             $($pattern)+ => true,
             _ => false
         }
     }
--- a/gfx/wr/webrender/src/picture.rs
+++ b/gfx/wr/webrender/src/picture.rs
@@ -737,17 +737,17 @@ impl Tile {
         ctx: &TilePreUpdateContext,
     ) {
         self.rect = rect;
         self.invalidation_reason  = None;
 
         self.clipped_rect = self.rect
             .intersection(&ctx.local_rect)
             .and_then(|r| r.intersection(&ctx.local_clip_rect))
-            .unwrap_or_else(PictureRect::zero);
+            .unwrap_or(PictureRect::zero());
 
         self.world_rect = ctx.pic_to_world_mapper
             .map(&self.rect)
             .expect("bug: map local tile rect");
 
         // Check if this tile is currently on screen.
         self.is_visible = self.world_rect.intersects(&ctx.global_screen_world_rect);
 
@@ -933,17 +933,17 @@ impl Tile {
         // rect to be the size of the entire tile.
         if !self.is_valid && !supports_dirty_rects {
             self.dirty_rect = self.rect;
         }
 
         // Ensure that the dirty rect doesn't extend outside the local tile rect.
         self.dirty_rect = self.dirty_rect
             .intersection(&self.rect)
-            .unwrap_or_else(PictureRect::zero);
+            .unwrap_or(PictureRect::zero());
 
         // See if this tile is a simple color, in which case we can just draw
         // it as a rect, and avoid allocating a texture surface and drawing it.
         // TODO(gw): Initial native compositor interface doesn't support simple
         //           color tiles. We can definitely support this in DC, so this
         //           should be added as a follow up.
         let is_simple_prim =
             ctx.backdrop.kind.can_be_promoted_to_compositor_surface() &&
@@ -1345,17 +1345,17 @@ impl DirtyRegion {
             dirty_rects,
             combined,
         }
     }
 
     /// Creates a record of this dirty region for exporting to test infrastructure.
     pub fn record(&self) -> RecordedDirtyRegion {
         let mut rects: Vec<WorldRect> =
-            self.dirty_rects.iter().map(|r| r.world_rect).collect();
+            self.dirty_rects.iter().map(|r| r.world_rect.clone()).collect();
         rects.sort_unstable_by_key(|r| (r.origin.y as usize, r.origin.x as usize));
         RecordedDirtyRegion { rects }
     }
 }
 
 /// A recorded copy of the dirty region for exporting to test infrastructure.
 #[cfg_attr(feature = "capture", derive(Serialize))]
 pub struct RecordedDirtyRegion {
@@ -1823,17 +1823,17 @@ impl TileCacheInstance {
         // but have just recently gone off-screen. This means that we avoid re-drawing
         // tiles if the user is scrolling up and down small amounts, at the cost of
         // a bit of extra texture memory.
         let desired_rect_in_pic_space = screen_rect_in_pic_space
             .inflate(0.0, 3.0 * self.tile_size.height);
 
         let needed_rect_in_pic_space = desired_rect_in_pic_space
             .intersection(&pic_rect)
-            .unwrap_or_else(PictureRect::zero);
+            .unwrap_or(PictureRect::zero());
 
         let p0 = needed_rect_in_pic_space.origin;
         let p1 = needed_rect_in_pic_space.bottom_right();
 
         let x0 = (p0.x / local_tile_rect.size.width).floor() as i32;
         let x1 = (p1.x / local_tile_rect.size.width).ceil() as i32;
 
         let y0 = (p0.y / local_tile_rect.size.height).floor() as i32;
@@ -2004,19 +2004,20 @@ impl TileCacheInstance {
         let clip_instances = &clip_store
             .clip_node_instances[prim_clip_chain.clips_range.to_range()];
         for clip_instance in clip_instances {
             prim_info.clips.push(clip_instance.handle.uid());
 
             // If the clip has the same spatial node, the relative transform
             // will always be the same, so there's no need to depend on it.
             let clip_node = &data_stores.clip[clip_instance.handle];
-            if clip_node.item.spatial_node_index != self.spatial_node_index
-                && !prim_info.spatial_nodes.contains(&clip_node.item.spatial_node_index) {
-                prim_info.spatial_nodes.push(clip_node.item.spatial_node_index);
+            if clip_node.item.spatial_node_index != self.spatial_node_index {
+                if !prim_info.spatial_nodes.contains(&clip_node.item.spatial_node_index) {
+                    prim_info.spatial_nodes.push(clip_node.item.spatial_node_index);
+                }
             }
         }
 
         // Certain primitives may select themselves to be a backdrop candidate, which is
         // then applied below.
         let mut backdrop_candidate = None;
 
         // For pictures, we don't (yet) know the valid clip rect, so we can't correctly
@@ -2117,20 +2118,20 @@ impl TileCacheInstance {
                     // text run doesn't get subpx for other reasons (e.g. glyph size).
                     let subpx_requested = match run_data.font.render_mode {
                         FontRenderMode::Subpixel => true,
                         FontRenderMode::Alpha | FontRenderMode::Mono => false,
                     };
 
                     // If a text run is on a child surface, the subpx mode will be
                     // correctly determined as we recurse through pictures in take_context.
-                    if on_picture_surface
-                        && subpx_requested
-                        && !self.backdrop.rect.contains_rect(&pic_clip_rect) {
-                        self.subpixel_mode = SubpixelMode::Deny;
+                    if on_picture_surface && subpx_requested {
+                        if !self.backdrop.rect.contains_rect(&pic_clip_rect) {
+                            self.subpixel_mode = SubpixelMode::Deny;
+                        }
                     }
                 }
             }
             PrimitiveInstanceKind::Clear { .. } => {
                 backdrop_candidate = Some(BackdropKind::Clear);
             }
             PrimitiveInstanceKind::LineDecoration { .. } |
             PrimitiveInstanceKind::NormalBorder { .. } |
@@ -2169,23 +2170,23 @@ impl TileCacheInstance {
 
                         prim_spatial_node.coordinate_system_id == surface_spatial_node.coordinate_system_id
                     };
 
                     same_coord_system && on_picture_surface
                 }
             };
 
-            if is_suitable_backdrop
-                && !prim_clip_chain.needs_mask
-                && pic_clip_rect.contains_rect(&self.backdrop.rect) {
-                self.backdrop = BackdropInfo {
-                    rect: pic_clip_rect,
-                    kind: backdrop_candidate,
-                };
+            if is_suitable_backdrop {
+                if !prim_clip_chain.needs_mask && pic_clip_rect.contains_rect(&self.backdrop.rect) {
+                    self.backdrop = BackdropInfo {
+                        rect: pic_clip_rect,
+                        kind: backdrop_candidate,
+                    }
+                }
             }
         }
 
         // Record any new spatial nodes in the used list.
         self.used_spatial_nodes.extend(&prim_info.spatial_nodes);
 
         // Truncate the lengths of dependency arrays to the max size we can handle.
         // Any arrays this size or longer will invalidate every frame.
@@ -3605,17 +3606,17 @@ impl PicturePrimitive {
                     PictureCompositeMode::TileCache { .. } => {
                         let tile_cache = self.tile_cache.as_mut().unwrap();
                         let mut first = true;
 
                         // Get the overall world space rect of the picture cache. Used to clip
                         // the tile rects below for occlusion testing to the relevant area.
                         let local_clip_rect = tile_cache.local_rect
                             .intersection(&tile_cache.local_clip_rect)
-                            .unwrap_or_else(PictureRect::zero);
+                            .unwrap_or(PictureRect::zero());
 
                         let world_clip_rect = map_pic_to_world
                             .map(&local_clip_rect)
                             .expect("bug: unable to map clip rect");
 
                         for key in &tile_cache.tiles_to_draw {
                             let tile = tile_cache.tiles.get_mut(key).expect("bug: no tile found!");
 
@@ -4399,21 +4400,23 @@ impl PicturePrimitive {
 
             let mut surface_rect = surface.rect * Scale::new(1.0);
 
             // Pop this surface from the stack
             let surface_index = state.pop_surface();
             debug_assert_eq!(surface_index, raster_config.surface_index);
 
             // Check if any of the surfaces can't be rasterized in local space but want to.
-            if raster_config.establishes_raster_root
-                && (surface_rect.size.width > MAX_SURFACE_SIZE
-                    || surface_rect.size.height > MAX_SURFACE_SIZE) {
-                raster_config.establishes_raster_root = false;
-                state.are_raster_roots_assigned = false;
+            if raster_config.establishes_raster_root {
+                if surface_rect.size.width > MAX_SURFACE_SIZE ||
+                    surface_rect.size.height > MAX_SURFACE_SIZE
+                {
+                    raster_config.establishes_raster_root = false;
+                    state.are_raster_roots_assigned = false;
+                }
             }
 
             // Set the estimated and precise local rects. The precise local rect
             // may be changed again during frame visibility.
             self.estimated_local_rect = surface_rect;
             self.precise_local_rect = surface_rect;
 
             // Drop shadows draw both a content and shadow rect, so need to expand the local
@@ -5100,17 +5103,17 @@ impl TileNode {
 
                 // Create the child nodes and switch from leaf -> node.
                 let children = child_indices
                     .iter_mut()
                     .map(|i| TileNode::new_leaf(mem::replace(i, Vec::new())))
                     .collect();
 
                 self.kind = TileNodeKind::Node {
-                    children,
+                    children: children,
                 };
             }
             Some(TileModification::Merge) => {
                 // Construct a merged index buffer by collecting the dependency index buffers
                 // from each child, and merging them into a de-duplicated index buffer.
                 let merged_indices = match self.kind {
                     TileNodeKind::Node { ref mut children, .. } => {
                         let mut merged_indices = Vec::new();
--- a/gfx/wr/webrender/src/platform/unix/font.rs
+++ b/gfx/wr/webrender/src/platform/unix/font.rs
@@ -360,17 +360,17 @@ impl FontContext {
             let index = native_font_handle.index;
             if let Some(face) = new_ft_face(font_key, self.lib, &file, index) {
                 self.faces.insert(*font_key, FontFace { file, index, face, mm_var: ptr::null_mut() });
             }
         }
     }
 
     pub fn delete_font(&mut self, font_key: &FontKey) {
-        if self.faces.remove(font_key).is_some() {
+        if let Some(_) = self.faces.remove(font_key) {
             self.variations.retain(|k, _| k.0 != *font_key);
         }
     }
 
     pub fn delete_font_instance(&mut self, instance: &FontInstance) {
         // Ensure we don't keep around excessive amounts of stale variations.
         if !instance.variations.is_empty() {
             self.variations.remove(&(instance.font_key, instance.variations.clone()));
--- a/gfx/wr/webrender/src/platform/windows/font.rs
+++ b/gfx/wr/webrender/src/platform/windows/font.rs
@@ -248,17 +248,17 @@ impl FontContext {
             let current_height = i * width * 3;
 
             for pixel in data[current_height .. current_height + (width * 3)].chunks(3) {
                 let r = pixel[0];
                 let g = pixel[1];
                 let b = pixel[2];
                 print!("({}, {}, {}) ", r, g, b,);
             }
-            println!();
+            println!("");
         }
     }
 
     fn get_font_face(
         &mut self,
         font: &FontInstance,
     ) -> &dwrote::FontFace {
         if !font.flags.contains(FontInstanceFlags::SYNTHETIC_BOLD) &&
--- a/gfx/wr/webrender/src/prim_store/mod.rs
+++ b/gfx/wr/webrender/src/prim_store/mod.rs
@@ -120,17 +120,17 @@ impl PrimitiveOpacity {
     }
 
     pub fn from_alpha(alpha: f32) -> PrimitiveOpacity {
         PrimitiveOpacity {
             is_opaque: alpha >= 1.0,
         }
     }
 
-    pub fn combine(self, other: PrimitiveOpacity) -> PrimitiveOpacity {
+    pub fn combine(&self, other: PrimitiveOpacity) -> PrimitiveOpacity {
         PrimitiveOpacity{
             is_opaque: self.is_opaque && other.is_opaque
         }
     }
 }
 
 #[derive(Clone, Debug)]
 pub struct SpaceSnapper {
@@ -373,23 +373,23 @@ impl ClipTaskIndex {
 }
 
 #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash, MallocSizeOf, Ord, PartialOrd)]
 #[cfg_attr(feature = "capture", derive(Serialize))]
 #[cfg_attr(feature = "replay", derive(Deserialize))]
 pub struct PictureIndex(pub usize);
 
 impl GpuCacheHandle {
-    pub fn as_int(self, gpu_cache: &GpuCache) -> i32 {
+    pub fn as_int(&self, gpu_cache: &GpuCache) -> i32 {
         gpu_cache.get_address(self).as_int()
     }
 }
 
 impl GpuCacheAddress {
-    pub fn as_int(self) -> i32 {
+    pub fn as_int(&self) -> i32 {
         // TODO(gw): Temporarily encode GPU Cache addresses as a single int.
         //           In the future, we can change the PrimitiveInstanceData struct
         //           to use 2x u16 for the vertex attribute instead of an i32.
         self.v as i32 * MAX_VERTEX_TEXTURE_WIDTH as i32 + self.u as i32
     }
 }
 
 /// The information about an interned primitive that
@@ -2013,18 +2013,20 @@ impl PrimitiveStore {
                         // so ensure that is kept up to date here.
                         // TODO(gw): It's unfortunate that the prim origin is duplicated
                         //           this way. In future, we could perhaps just store the
                         //           size in the picture primitive, to that there isn't
                         //           any duplicated data.
                         let pic = &self.pictures[pic_index.0];
                         prim_instance.prim_origin = pic.precise_local_rect.origin;
 
-                        if prim_instance.is_chased() && pic.estimated_local_rect != pic.precise_local_rect {
-                            println!("\testimate {:?} adjusted to {:?}", pic.estimated_local_rect, pic.precise_local_rect);
+                        if prim_instance.is_chased() {
+                            if pic.estimated_local_rect != pic.precise_local_rect {
+                                println!("\testimate {:?} adjusted to {:?}", pic.estimated_local_rect, pic.precise_local_rect);
+                            }
                         }
 
                         let mut shadow_rect = pic.precise_local_rect;
                         match pic.raster_config {
                             Some(ref rc) => match rc.composite_mode {
                                 // If we have a drop shadow filter, we also need to include the shadow in
                                 // our shadowed local rect for the purpose of calculating the size of the
                                 // picture.
@@ -2246,21 +2248,19 @@ impl PrimitiveStore {
                             PrimitiveInstanceKind::Clear { .. } => debug_colors::CYAN,
                             PrimitiveInstanceKind::Backdrop { .. } => debug_colors::MEDIUMAQUAMARINE,
                         };
                         if debug_color.a != 0.0 {
                             let debug_rect = clipped_world_rect * frame_context.global_device_pixel_scale;
                             frame_state.scratch.push_debug_rect(debug_rect, debug_color, debug_color.scale_alpha(0.5));
                         }
                     } else if frame_context.debug_flags.contains(::api::DebugFlags::OBSCURE_IMAGES) {
-                        let is_image = matches!(
-                            prim_instance.kind,
-                            PrimitiveInstanceKind::Image { .. } | PrimitiveInstanceKind::YuvImage { .. }
-                        );
-                        if is_image {
+                        if matches!(prim_instance.kind, PrimitiveInstanceKind::Image { .. } |
+                                                        PrimitiveInstanceKind::YuvImage { .. })
+                        {
                             // We allow "small" images, since they're generally UI elements.
                             let rect = clipped_world_rect * frame_context.global_device_pixel_scale;
                             if rect.size.width > 70.0 && rect.size.height > 70.0 {
                                 frame_state.scratch.push_debug_rect(rect, debug_colors::PURPLE, debug_colors::PURPLE);
                             }
                         }
                     }
 
--- a/gfx/wr/webrender/src/profiler.rs
+++ b/gfx/wr/webrender/src/profiler.rs
@@ -953,22 +953,22 @@ impl ProfileGraph {
         let mut stats = GraphStats {
             min_value: f32::MAX,
             mean_value: 0.0,
             max_value: -f32::MAX,
         };
 
         for value in &self.values {
             stats.min_value = stats.min_value.min(*value);
-            stats.mean_value += *value;
+            stats.mean_value = stats.mean_value + *value;
             stats.max_value = stats.max_value.max(*value);
         }
 
         if !self.values.is_empty() {
-            stats.mean_value /= self.values.len() as f32;
+            stats.mean_value = stats.mean_value / self.values.len() as f32;
         }
 
         stats
     }
 
     fn draw_graph(
         &self,
         x: f32,
--- a/gfx/wr/webrender/src/render_backend.rs
+++ b/gfx/wr/webrender/src/render_backend.rs
@@ -451,20 +451,21 @@ impl Document {
                         let test = HitTest::new(None, cursor, HitTestFlags::empty());
                         hit_tester.find_node_under_point(test)
                     }
                     None => {
                         None
                     }
                 };
 
-                if self.hit_tester.is_some()
-                    && self.scroll_nearest_scrolling_ancestor(delta, node_index) {
-                    self.hit_tester_is_valid = false;
-                    self.frame_is_valid = false;
+                if self.hit_tester.is_some() {
+                    if self.scroll_nearest_scrolling_ancestor(delta, node_index) {
+                        self.hit_tester_is_valid = false;
+                        self.frame_is_valid = false;
+                    }
                 }
 
                 return DocumentOps {
                     // TODO: Does it make sense to track this as a scrolling even if we
                     // ended up not scrolling anything?
                     scroll: true,
                     ..DocumentOps::nop()
                 };
@@ -1627,29 +1628,29 @@ impl RenderBackend {
             doc.scene.clip_scroll_tree.print_with(&mut builder);
 
             debug_root.add(builder.build());
         }
 
         serde_json::to_string(&debug_root).unwrap()
     }
 
-    fn report_memory(&mut self, tx: MsgSender<Box<MemoryReport>>) {
-        let mut report = Box::new(MemoryReport::default());
+    fn report_memory(&mut self, tx: MsgSender<MemoryReport>) {
+        let mut report = MemoryReport::default();
         let ops = self.size_of_ops.as_mut().unwrap();
         let op = ops.size_of_op;
         report.gpu_cache_metadata = self.gpu_cache.size_of(ops);
-        for doc in self.documents.values() {
+        for (_id, doc) in &self.documents {
             report.clip_stores += doc.scene.clip_store.size_of(ops);
             report.hit_testers += doc.hit_tester.size_of(ops);
 
             doc.data_stores.report_memory(ops, &mut report)
         }
 
-        (*report) += self.resource_cache.report_memory(op);
+        report += self.resource_cache.report_memory(op);
 
         // Send a message to report memory on the scene-builder thread, which
         // will add its report to this one and send the result back to the original
         // thread waiting on the request.
         self.scene_tx.send(SceneBuilderRequest::ReportMemory(report, tx)).unwrap();
     }
 }
 
@@ -1880,17 +1881,17 @@ impl RenderBackend {
                     // it (but we do want to update the scene builder's state)
                     false
                 }
                 None => true,
             };
 
             scenes_to_build.push(LoadScene {
                 document_id: id,
-                scene,
+                scene: scene,
                 view: view.clone(),
                 config: self.frame_config.clone(),
                 output_pipelines: doc.output_pipelines.clone(),
                 font_instances: self.resource_cache.get_font_instances(),
                 build_frame,
                 interners,
             });
 
--- a/gfx/wr/webrender/src/render_task.rs
+++ b/gfx/wr/webrender/src/render_task.rs
@@ -1447,39 +1447,39 @@ impl RenderTask {
                 uv_rect_kind,
             };
             image_source.write_gpu_blocks(&mut request);
         }
 
         if let RenderTaskKind::SvgFilter(ref mut filter_task) = self.kind {
             match filter_task.info {
                 SvgFilterInfo::ColorMatrix(ref matrix) => {
-                    let handle = filter_task.extra_gpu_cache_handle.get_or_insert_with(GpuCacheHandle::new);
+                    let handle = filter_task.extra_gpu_cache_handle.get_or_insert_with(|| GpuCacheHandle::new());
                     if let Some(mut request) = gpu_cache.request(handle) {
                         for i in 0..5 {
                             request.push([matrix[i*4], matrix[i*4+1], matrix[i*4+2], matrix[i*4+3]]);
                         }
                     }
                 }
                 SvgFilterInfo::DropShadow(color) |
                 SvgFilterInfo::Flood(color) => {
-                    let handle = filter_task.extra_gpu_cache_handle.get_or_insert_with(GpuCacheHandle::new);
+                    let handle = filter_task.extra_gpu_cache_handle.get_or_insert_with(|| GpuCacheHandle::new());
                     if let Some(mut request) = gpu_cache.request(handle) {
                         request.push(color.to_array());
                     }
                 }
                 SvgFilterInfo::ComponentTransfer(ref data) => {
-                    let handle = filter_task.extra_gpu_cache_handle.get_or_insert_with(GpuCacheHandle::new);
+                    let handle = filter_task.extra_gpu_cache_handle.get_or_insert_with(|| GpuCacheHandle::new());
                     if let Some(request) = gpu_cache.request(handle) {
                         data.update(request);
                     }
                 }
                 SvgFilterInfo::Composite(ref operator) => {
                     if let CompositeOperator::Arithmetic(k_vals) = operator {
-                        let handle = filter_task.extra_gpu_cache_handle.get_or_insert_with(GpuCacheHandle::new);
+                        let handle = filter_task.extra_gpu_cache_handle.get_or_insert_with(|| GpuCacheHandle::new());
                         if let Some(mut request) = gpu_cache.request(handle) {
                             request.push(*k_vals);
                         }
                     }
                 }
                 _ => {},
             }
         }
--- a/gfx/wr/webrender/src/renderer.rs
+++ b/gfx/wr/webrender/src/renderer.rs
@@ -2022,71 +2022,71 @@ impl Renderer {
             Some(shaders) => Rc::clone(&shaders.shaders),
             None => Rc::new(RefCell::new(Shaders::new(&mut device, gl_type, &options)?)),
         };
 
         let backend_profile_counters = BackendProfileCounters::new();
 
         let dither_matrix_texture = if options.enable_dithering {
             let dither_matrix: [u8; 64] = [
-                0,
+                00,
                 48,
                 12,
                 60,
-                3,
+                03,
                 51,
                 15,
                 63,
                 32,
                 16,
                 44,
                 28,
                 35,
                 19,
                 47,
                 31,
-                8,
+                08,
                 56,
-                4,
+                04,
                 52,
                 11,
                 59,
-                7,
+                07,
                 55,
                 40,
                 24,
                 36,
                 20,
                 43,
                 27,
                 39,
                 23,
-                2,
+                02,
                 50,
                 14,
                 62,
-                1,
+                01,
                 49,
                 13,
                 61,
                 34,
                 18,
                 46,
                 30,
                 33,
                 17,
                 45,
                 29,
                 10,
                 58,
-                6,
+                06,
                 54,
-                9,
+                09,
                 57,
-                5,
+                05,
                 53,
                 42,
                 26,
                 38,
                 22,
                 41,
                 25,
                 37,
@@ -3126,17 +3126,17 @@ impl Renderer {
                 self.draw_frame(
                     frame,
                     device_size,
                     cpu_frame_id,
                     &mut results,
                     doc_index == 0,
                 );
 
-                if device_size.is_some() {
+                if let Some(_) = device_size {
                     self.draw_frame_debug_items(&frame.debug_items);
                 }
                 if self.debug_flags.contains(DebugFlags::PROFILER_DBG) {
                     frame_profiles.push(frame.profile_counters.clone());
                 }
 
                 let dirty_regions =
                     mem::replace(&mut frame.recorded_dirty_regions, Vec::new());
@@ -3361,17 +3361,17 @@ impl Renderer {
                 self.gpu_cache_frame_id = update_list.frame_id
             }
             self.gpu_cache_texture
                 .update(&mut self.device, &update_list);
         }
 
         let mut upload_time = TimeProfileCounter::new("GPU cache upload time", false, Some(0.0..2.0));
         let updated_rows = upload_time.profile(|| {
-            self.gpu_cache_texture.flush(&mut self.device)
+            return self.gpu_cache_texture.flush(&mut self.device);
         });
         self.gpu_cache_upload_time += upload_time.get();
 
         let counters = &mut self.backend_profile_counters.resources.gpu_cache;
         counters.updated_rows.set(updated_rows);
         counters.updated_blocks.set(updated_blocks);
     }
 
@@ -3925,17 +3925,17 @@ impl Renderer {
 
             // Draw opaque batches front-to-back for maximum
             // z-buffer efficiency!
             for batch in alpha_batch_container
                 .opaque_batches
                 .iter()
                 .rev()
                 {
-                    if should_skip_batch(&batch.key.kind, self.debug_flags) {
+                    if should_skip_batch(&batch.key.kind, &self.debug_flags) {
                         continue;
                     }
 
                     self.shaders.borrow_mut()
                         .get(&batch.key, batch.features, self.debug_flags)
                         .bind(
                             &mut self.device, projection,
                             &mut self.renderer_errors,
@@ -3976,17 +3976,17 @@ impl Renderer {
                 self.init_pixel_local_storage(
                     alpha_batch_container.task_rect,
                     projection,
                     stats,
                 );
             }
 
             for batch in &alpha_batch_container.alpha_batches {
-                if should_skip_batch(&batch.key.kind, self.debug_flags) {
+                if should_skip_batch(&batch.key.kind, &self.debug_flags) {
                     continue;
                 }
 
                 let mut shaders = shaders_rc.borrow_mut();
                 let shader = shaders.get(
                     &batch.key,
                     batch.features | BatchFeatures::ALPHA_PASS,
                     self.debug_flags,
@@ -4561,17 +4561,17 @@ impl Renderer {
                 stats,
             );
         }
         // draw box-shadow clips
         for (mask_texture_id, items) in list.box_shadows.iter() {
             let _gm2 = self.gpu_profile.start_marker("box-shadows");
             let textures = BatchTextures {
                 colors: [
-                    *mask_texture_id,
+                    mask_texture_id.clone(),
                     TextureSource::Invalid,
                     TextureSource::Invalid,
                 ],
             };
             self.shaders.borrow_mut().cs_clip_box_shadow
                 .bind(&mut self.device, projection, &mut self.renderer_errors);
             self.draw_instanced_batch(
                 items,
@@ -4581,17 +4581,17 @@ impl Renderer {
             );
         }
 
         // draw image masks
         for (mask_texture_id, items) in list.images.iter() {
             let _gm2 = self.gpu_profile.start_marker("clip images");
             let textures = BatchTextures {
                 colors: [
-                    *mask_texture_id,
+                    mask_texture_id.clone(),
                     TextureSource::Invalid,
                     TextureSource::Invalid,
                 ],
             };
             self.shaders.borrow_mut().cs_clip_image
                 .bind(&mut self.device, projection, &mut self.renderer_errors);
             self.draw_instanced_batch(
                 items,
@@ -5491,17 +5491,17 @@ impl Renderer {
             VertexArrayKind::Resolve,
             &BatchTextures::no_texture(),
             stats,
         );
 
         self.device.enable_pixel_local_storage(false);
     }
 
-    pub fn debug_renderer(&mut self) -> Option<&mut DebugRenderer> {
+    pub fn debug_renderer<'b>(&'b mut self) -> Option<&'b mut DebugRenderer> {
         self.debug.get_mut(&mut self.device)
     }
 
     pub fn get_debug_flags(&self) -> DebugFlags {
         self.debug_flags
     }
 
     pub fn set_debug_flags(&mut self, flags: DebugFlags) {
@@ -5833,17 +5833,17 @@ impl Renderer {
                 ColorU::new(255, 255, 0, 255),
                 None,
             ).size.width;
             text_width = f32::max(text_width, w);
         }
 
         let margin = 10.0;
         debug_renderer.add_quad(
-            x0 - margin,
+            &x0 - margin,
             y0 - margin,
             x0 + text_width + margin,
             y + margin,
             ColorU::new(25, 25, 25, 200),
             ColorU::new(51, 51, 51, 200),
         );
     }
 
@@ -6756,17 +6756,19 @@ impl Renderer {
         }
 
         self.output_image_handler = Some(Box::new(VoidHandler) as Box<_>);
         self.external_image_handler = Some(Box::new(image_handler) as Box<_>);
         info!("done.");
     }
 }
 
-fn get_vao(vertex_array_kind: VertexArrayKind, vaos: &RendererVAOs) -> &VAO {
+fn get_vao<'a>(vertex_array_kind: VertexArrayKind,
+               vaos: &'a RendererVAOs)
+               -> &'a VAO {
     match vertex_array_kind {
         VertexArrayKind::Primitive => &vaos.prim_vao,
         VertexArrayKind::Clip => &vaos.clip_vao,
         VertexArrayKind::Blur => &vaos.blur_vao,
         VertexArrayKind::VectorStencil | VertexArrayKind::VectorCover => unreachable!(),
         VertexArrayKind::Border => &vaos.border_vao,
         VertexArrayKind::Scale => &vaos.scale_vao,
         VertexArrayKind::LineDecoration => &vaos.line_vao,
@@ -6777,17 +6779,17 @@ fn get_vao(vertex_array_kind: VertexArra
     }
 }
 #[derive(Clone, Copy, PartialEq)]
 enum FramebufferKind {
     Main,
     Other,
 }
 
-fn should_skip_batch(kind: &BatchKind, flags: DebugFlags) -> bool {
+fn should_skip_batch(kind: &BatchKind, flags: &DebugFlags) -> bool {
     match kind {
         BatchKind::TextRun(_) => {
             flags.contains(DebugFlags::DISABLE_TEXT_PRIMS)
         }
         BatchKind::Brush(BrushBatchKind::RadialGradient) |
         BatchKind::Brush(BrushBatchKind::LinearGradient) => {
             flags.contains(DebugFlags::DISABLE_GRADIENT_PRIMS)
         }
--- a/gfx/wr/webrender/src/resource_cache.rs
+++ b/gfx/wr/webrender/src/resource_cache.rs
@@ -395,17 +395,17 @@ enum ImageResult {
 impl ImageResult {
     /// Releases any texture cache entries held alive by this ImageResult.
     fn drop_from_cache(&mut self, texture_cache: &mut TextureCache) {
         match *self {
             ImageResult::UntiledAuto(ref mut entry) => {
                 entry.mark_unused(texture_cache);
             },
             ImageResult::Multi(ref mut entries) => {
-                for entry in entries.resources.values_mut() {
+                for (_, entry) in &mut entries.resources {
                     entry.mark_unused(texture_cache);
                 }
             },
             ImageResult::Err(_) => {},
         }
     }
 }
 
@@ -781,25 +781,27 @@ impl ResourceCache {
                         };
                         if let Some(entry) = entries.try_get_mut(&cached_key) {
                             entry.dirty_rect = DirtyRect::All;
                         }
                     }
                     _ => {}
                 }
 
-            } else if let RasterizedBlob::NonTiled(ref mut queue) = *image {
-                // If our new rasterized rect overwrites items in the queue, discard them.
-                queue.retain(|img| {
-                    !data.rasterized_rect.contains_rect(&img.rasterized_rect)
-                });
+            } else {
+                if let RasterizedBlob::NonTiled(ref mut queue) = *image {
+                    // If our new rasterized rect overwrites items in the queue, discard them.
+                    queue.retain(|img| {
+                        !data.rasterized_rect.contains_rect(&img.rasterized_rect)
+                    });
 
-                queue.push(data);
-            } else {
-                *image = RasterizedBlob::NonTiled(vec![data]);
+                    queue.push(data);
+                } else {
+                    *image = RasterizedBlob::NonTiled(vec![data]);
+                }
             }
         }
     }
 
     pub fn add_font_template(&mut self, font_key: FontKey, template: FontTemplate) {
         // Push the new font to the font renderer, and also store
         // it locally for glyph metric requests.
         self.glyph_rasterizer.add_font(font_key, template.clone());
@@ -930,17 +932,17 @@ impl ResourceCache {
                                 rect.origin -= tile_offset.to_vector();
 
                                 let tile_rect = compute_tile_size(
                                     &descriptor.size.into(),
                                     tile_size,
                                     tile,
                                 ).into();
 
-                                rect.intersection(&tile_rect).unwrap_or_else(DeviceIntRect::zero)
+                                rect.intersection(&tile_rect).unwrap_or(DeviceIntRect::zero())
                             })
                         }
                         (None, Some(..)) => DirtyRect::All,
                         _ => *dirty_rect,
                     };
                     entry.dirty_rect = entry.dirty_rect.union(&local_dirty_rect);
                 }
             }
@@ -1013,17 +1015,17 @@ impl ResourceCache {
                 &image.visible_rect,
                 visible_rect,
                 tile_size,
             );
         }
 
         match (image.valid_tiles_after_bounds_change, valid_tiles_after_bounds_change) {
             (Some(old), Some(ref mut new)) => {
-                *new = new.intersection(&old).unwrap_or_else(TileRange::zero);
+                *new = new.intersection(&old).unwrap_or(TileRange::zero());
             }
             (Some(old), None) => {
                 valid_tiles_after_bounds_change = Some(old);
             }
             _ => {}
         }
 
         let blob_size = visible_rect.size;
--- a/gfx/wr/webrender/src/scene_builder_thread.rs
+++ b/gfx/wr/webrender/src/scene_builder_thread.rs
@@ -139,17 +139,17 @@ pub enum SceneBuilderRequest {
     DeleteDocument(DocumentId),
     WakeUp,
     Flush(MsgSender<()>),
     ClearNamespace(IdNamespace),
     SetFrameBuilderConfig(FrameBuilderConfig),
     SimulateLongSceneBuild(u32),
     SimulateLongLowPrioritySceneBuild(u32),
     Stop,
-    ReportMemory(Box<MemoryReport>, MsgSender<Box<MemoryReport>>),
+    ReportMemory(MemoryReport, MsgSender<MemoryReport>),
     #[cfg(feature = "capture")]
     SaveScene(CaptureConfig),
     #[cfg(feature = "replay")]
     LoadScenes(Vec<LoadScene>),
     DocumentsForDebugger
 }
 
 // Message from scene builder to render backend.
@@ -357,17 +357,17 @@ impl SceneBuilderThread {
                 }
                 Ok(SceneBuilderRequest::Stop) => {
                     self.tx.send(SceneBuilderResult::Stopped).unwrap();
                     // We don't need to send a WakeUp to api_tx because we only
                     // get the Stop when the RenderBackend loop is exiting.
                     break;
                 }
                 Ok(SceneBuilderRequest::ReportMemory(mut report, tx)) => {
-                    (*report) += self.report_memory();
+                    report += self.report_memory();
                     tx.send(report).unwrap();
                 }
                 Ok(SceneBuilderRequest::SimulateLongSceneBuild(time_ms)) => {
                     self.simulate_slow_ms = time_ms
                 }
                 Ok(SceneBuilderRequest::SimulateLongLowPrioritySceneBuild(_)) => {}
                 Err(_) => {
                     break;
@@ -513,17 +513,17 @@ impl SceneBuilderThread {
             docs.add(debug_doc);
         }
 
         serde_json::to_string(&docs).unwrap()
     }
 
     /// Do the bulk of the work of the scene builder thread.
     fn process_transaction(&mut self, txn: &mut Transaction) -> Box<BuiltTransaction> {
-        if let Some(ref hooks) = self.hooks {
+        if let &Some(ref hooks) = &self.hooks {
             hooks.pre_scene_build();
         }
 
         let scene_build_start_time = precise_time_ns();
 
         let doc = self.documents
                       .entry(txn.document_id)
                       .or_insert_with(|| Document::new(Scene::new()));
@@ -607,18 +607,18 @@ impl SceneBuilderThread {
             interner_updates,
             scene_build_start_time,
             scene_build_end_time,
         })
     }
 
     /// Send the results of process_transaction back to the render backend.
     fn forward_built_transactions(&mut self, txns: Vec<Box<BuiltTransaction>>) {
-        let (pipeline_info, result_tx, result_rx) = match self.hooks {
-            Some(ref hooks) => {
+        let (pipeline_info, result_tx, result_rx) = match &self.hooks {
+            &Some(ref hooks) => {
                 if txns.iter().any(|txn| txn.built_scene.is_some()) {
                     let info = PipelineInfo {
                         epochs: txns.iter()
                             .filter(|txn| txn.built_scene.is_some())
                             .map(|txn| {
                                 txn.built_scene.as_ref().unwrap()
                                     .pipeline_epochs.iter()
                                     .zip(iter::repeat(txn.document_id))
@@ -641,42 +641,47 @@ impl SceneBuilderThread {
             _ => (None, None, None)
         };
 
         let scene_swap_start_time = precise_time_ns();
         let document_ids = txns.iter().map(|txn| txn.document_id).collect();
         let have_resources_updates : Vec<DocumentId> = if pipeline_info.is_none() {
             txns.iter()
                 .filter(|txn| !txn.resource_updates.is_empty() || txn.invalidate_rendered_frame)
-                .map(|txn| txn.document_id)
+                .map(|txn| txn.document_id.clone())
                 .collect()
         } else {
             Vec::new()
         };
 
         self.tx.send(SceneBuilderResult::Transactions(txns, result_tx)).unwrap();
 
         let _ = self.api_tx.send(ApiMsg::WakeUp);
 
         if let Some(pipeline_info) = pipeline_info {
             // Block until the swap is done, then invoke the hook.
             let swap_result = result_rx.unwrap().recv();
             let scene_swap_time = precise_time_ns() - scene_swap_start_time;
             self.hooks.as_ref().unwrap().post_scene_swap(&document_ids,
                                                          pipeline_info, scene_swap_time);
             // Once the hook is done, allow the RB thread to resume
-            if let Ok(SceneSwapResult::Complete(resume_tx)) = swap_result {
-                resume_tx.send(()).ok();
-            }
+            match swap_result {
+                Ok(SceneSwapResult::Complete(resume_tx)) => {
+                    resume_tx.send(()).ok();
+                },
+                _ => (),
+            };
         } else if !have_resources_updates.is_empty() {
-            if let Some(ref hooks) = self.hooks {
+            if let &Some(ref hooks) = &self.hooks {
                 hooks.post_resource_update(&have_resources_updates);
             }
-        } else if let Some(ref hooks) = self.hooks {
-            hooks.post_empty_scene_build();
+        } else {
+            if let &Some(ref hooks) = &self.hooks {
+                hooks.post_empty_scene_build();
+            }
         }
     }
 
     /// Reports CPU heap memory used by the SceneBuilder.
     fn report_memory(&mut self) -> MemoryReport {
         let ops = self.size_of_ops.as_mut().unwrap();
         let mut report = MemoryReport::default();
         for doc in self.documents.values() {
--- a/gfx/wr/webrender/src/scene_building.rs
+++ b/gfx/wr/webrender/src/scene_building.rs
@@ -659,17 +659,17 @@ impl<'a> SceneBuilder<'a> {
             // occur while not scrolling (such as animation, video etc);
             let scroll_root = slice.cache_scroll_root.unwrap_or(ROOT_SPATIAL_NODE_INDEX);
 
             let instance = create_tile_cache(
                 slice_index,
                 scroll_root,
                 slice.prim_list,
                 background_color,
-                slice.shared_clips.unwrap_or_else(Vec::new),
+                slice.shared_clips.unwrap_or(Vec::new()),
                 &mut self.interners,
                 &mut self.prim_store,
                 &mut self.clip_store,
                 &mut self.picture_cache_spatial_nodes,
             );
 
             main_prim_list.add_prim(
                 instance,
@@ -722,17 +722,17 @@ impl<'a> SceneBuilder<'a> {
             for (label, stats) in stats {
                 println!("{}, {}, {}kb, {}%, {}",
                     label,
                     stats.total_count,
                     stats.num_bytes / 1000,
                     ((stats.num_bytes as f32 / total_bytes.max(1) as f32) * 100.0) as usize,
                     stats.num_bytes / stats.total_count.max(1));
             }
-            println!();
+            println!("");
         }
     }
 
     fn build_sticky_frame(
         &mut self,
         info: &StickyFrameDisplayItem,
         parent_node_index: SpatialNodeIndex,
     ) {
@@ -3735,17 +3735,17 @@ impl FlattenedStackingContext {
 
         // If there are svg filters
         if !self.composite_ops.filter_primitives.is_empty() {
             return false;
         }
 
         // We can skip mix-blend modes if they are the first primitive in a stacking context,
         // see pop_stacking_context for a full explanation.
-        if self.composite_ops.mix_blend_mode.is_some() &&
+        if !self.composite_ops.mix_blend_mode.is_none() &&
             !parent.prim_list.is_empty() {
             return false;
         }
 
         // If backface visibility is explicitly set.
         if !self.prim_flags.contains(PrimitiveFlags::IS_BACKFACE_VISIBLE) {
             return false;
         }
@@ -3948,17 +3948,17 @@ fn filter_datas_for_compositing(
 
 fn filter_primitives_for_compositing(
     input_filter_primitives: ItemRange<FilterPrimitive>,
 ) -> Vec<FilterPrimitive> {
     // Resolve these in the flattener?
     // TODO(gw): Now that we resolve these later on,
     //           we could probably make it a bit
     //           more efficient than cloning these here.
-    input_filter_primitives.iter().map(|primitive| primitive).collect()
+    input_filter_primitives.iter().map(|primitive| primitive.into()).collect()
 }
 
 fn process_repeat_size(
     snapped_rect: &LayoutRect,
     unsnapped_rect: &LayoutRect,
     repeat_size: LayoutSize,
 ) -> LayoutSize {
     LayoutSize::new(
--- a/gfx/wr/webrender/src/spatial_node.rs
+++ b/gfx/wr/webrender/src/spatial_node.rs
@@ -295,16 +295,17 @@ impl SpatialNode {
         self.is_ancestor_or_self_zooming = self.is_async_zooming | is_parent_zooming;
 
         // If this node is a reference frame, we check if it has a non-invertible matrix.
         // For non-reference-frames we assume that they will produce only additional
         // translations which should be invertible.
         match self.node_type {
             SpatialNodeType::ReferenceFrame(info) if !info.invertible => {
                 self.mark_uninvertible(state);
+                return;
             }
             _ => self.invertible = true,
         }
     }
 
     pub fn update_transform(
         &mut self,
         state: &mut TransformUpdateState,
--- a/gfx/wr/webrender/src/storage.rs
+++ b/gfx/wr/webrender/src/storage.rs
@@ -55,17 +55,17 @@ impl<T> Range<T> {
     pub fn empty() -> Self {
         Range {
             start: Index::new(0),
             end: Index::new(0),
         }
     }
 
     /// Check for an empty `Range`
-    pub fn is_empty(self) -> bool {
+    pub fn is_empty(&self) -> bool {
         self.start.0 >= self.end.0
     }
 }
 
 #[cfg_attr(feature = "capture", derive(Serialize))]
 pub struct Storage<T> {
     data: Vec<T>,
 }
--- a/gfx/wr/webrender/src/texture_cache.rs
+++ b/gfx/wr/webrender/src/texture_cache.rs
@@ -983,17 +983,17 @@ impl TextureCache {
 
         // Create an update command, which the render thread processes
         // to upload the new image data into the correct location
         // in GPU memory.
         if let Some(data) = data {
             // If the swizzling is supported, we always upload in the internal
             // texture format (thus avoiding the conversion by the driver).
             // Otherwise, pass the external format to the driver.
-            let use_upload_format = self.swizzle.is_none();
+            let use_upload_format = !self.swizzle.is_some();
             let (layer_index, origin) = entry.details.describe();
             let op = TextureCacheUpdate::new_update(
                 data,
                 &descriptor,
                 origin,
                 entry.size,
                 layer_index as i32,
                 use_upload_format,
--- a/gfx/wr/webrender_api/src/api.rs
+++ b/gfx/wr/webrender_api/src/api.rs
@@ -1004,17 +1004,17 @@ pub enum ApiMsg {
     /// to forward gecko-specific messages to the render thread preserving the ordering
     /// within the other messages.
     ExternalEvent(ExternalEvent),
     /// Removes all resources associated with a namespace.
     ClearNamespace(IdNamespace),
     /// Flush from the caches anything that isn't necessary, to free some memory.
     MemoryPressure,
     /// Collects a memory report.
-    ReportMemory(MsgSender<Box<MemoryReport>>),
+    ReportMemory(MsgSender<MemoryReport>),
     /// Change debugging options.
     DebugCommand(DebugCommand),
     /// Wakes the render backend's event loop up. Needed when an event is communicated
     /// through another channel.
     WakeUp,
     /// See `RenderApi::wake_scene_builder`.
     WakeSceneBuilder,
     /// Block until a round-trip to the scene builder thread has completed. This
@@ -1533,17 +1533,17 @@ impl RenderApi {
     pub fn notify_memory_pressure(&self) {
         self.api_sender.send(ApiMsg::MemoryPressure).unwrap();
     }
 
     /// Synchronously requests memory report.
     pub fn report_memory(&self) -> MemoryReport {
         let (tx, rx) = channel::msg_channel().unwrap();
         self.api_sender.send(ApiMsg::ReportMemory(tx)).unwrap();
-        *rx.recv().unwrap()
+        rx.recv().unwrap()
     }
 
     /// Update debugging flags.
     pub fn set_debug_flags(&self, flags: DebugFlags) {
         let cmd = DebugCommand::SetFlags(flags);
         self.api_sender.send(ApiMsg::DebugCommand(cmd)).unwrap();
     }
 
@@ -1631,17 +1631,17 @@ impl RenderApi {
                     let (msg, payloads) = transaction.finalize();
                     msgs.push(msg);
                     document_payloads.push(payloads);
                     (msgs, document_payloads)
                 });
         for payload in document_payloads.drain(..).flatten() {
             self.payload_sender.send_payload(payload).unwrap();
         }
-        self.api_sender.send(ApiMsg::UpdateDocuments(document_ids, msgs)).unwrap();
+        self.api_sender.send(ApiMsg::UpdateDocuments(document_ids.clone(), msgs)).unwrap();
     }
 
     /// Does a hit test on display items in the specified document, at the given
     /// point. If a pipeline_id is specified, it is used to further restrict the
     /// hit results so that only items inside that pipeline are matched. If the
     /// HitTestFlags argument contains the FIND_ALL flag, then the vector of hit
     /// results will contain all display items that match, ordered from front
     /// to back.
@@ -1774,17 +1774,17 @@ pub struct ZoomFactor(f32);
 
 impl ZoomFactor {
     /// Construct a new zoom factor.
     pub fn new(scale: f32) -> Self {
         ZoomFactor(scale)
     }
 
     /// Get the zoom factor as an untyped float.
-    pub fn get(self) -> f32 {
+    pub fn get(&self) -> f32 {
         self.0
     }
 }
 
 /// A key to identify an animated property binding.
 #[repr(C)]
 #[derive(Clone, Copy, Debug, Default, Deserialize, MallocSizeOf, PartialEq, Serialize, Eq, Hash, PeekPoke)]
 pub struct PropertyBindingId {
@@ -1810,18 +1810,18 @@ pub struct PropertyBindingKey<T> {
     ///
     pub id: PropertyBindingId,
     _phantom: PhantomData<T>,
 }
 
 /// Construct a property value from a given key and value.
 impl<T: Copy> PropertyBindingKey<T> {
     ///
-    pub fn with(self, value: T) -> PropertyValue<T> {
-        PropertyValue { key: self, value }
+    pub fn with(&self, value: T) -> PropertyValue<T> {
+        PropertyValue { key: *self, value }
     }
 }
 
 impl<T> PropertyBindingKey<T> {
     /// Constructor.
     pub fn new(value: u64) -> Self {
         PropertyBindingKey {
             id: PropertyBindingId::new(value),
--- a/gfx/wr/webrender_api/src/color.rs
+++ b/gfx/wr/webrender_api/src/color.rs
@@ -90,18 +90,16 @@ impl ColorF {
 
 // Floats don't impl Hash/Eq/Ord...
 impl Eq for PremultipliedColorF {}
 impl Ord for PremultipliedColorF {
     fn cmp(&self, other: &Self) -> cmp::Ordering {
         self.partial_cmp(other).unwrap_or(cmp::Ordering::Equal)
     }
 }
-
-#[cfg_attr(feature = "cargo-clippy", allow(clippy::derive_hash_xor_eq))]
 impl Hash for PremultipliedColorF {
     fn hash<H: Hasher>(&self, state: &mut H) {
         // Note: this is inconsistent with the Eq impl for -0.0 (don't care).
         self.r.to_bits().hash(state);
         self.g.to_bits().hash(state);
         self.b.to_bits().hash(state);
         self.a.to_bits().hash(state);
     }
--- a/gfx/wr/webrender_api/src/display_item.rs
+++ b/gfx/wr/webrender_api/src/display_item.rs
@@ -528,18 +528,18 @@ pub enum BorderStyle {
     Hidden = 5,
     Groove = 6,
     Ridge = 7,
     Inset = 8,
     Outset = 9,
 }
 
 impl BorderStyle {
-    pub fn is_hidden(self) -> bool {
-        self == BorderStyle::Hidden || self == BorderStyle::None
+    pub fn is_hidden(&self) -> bool {
+        *self == BorderStyle::Hidden || *self == BorderStyle::None
     }
 }
 
 #[repr(u8)]
 #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, MallocSizeOf, PartialEq, Serialize, PeekPoke)]
 pub enum BoxShadowClipMode {
     Outset = 0,
     Inset = 1,
@@ -713,18 +713,18 @@ pub enum RasterSpace {
     // Rasterize the picture in screen-space, including rotation / skew etc in
     // the rasterized element. Best quality, but slower performance. Note that
     // any stacking context with a perspective transform will be rasterized
     // in local-space, even if this is set.
     Screen,
 }
 
 impl RasterSpace {
-    pub fn local_scale(self) -> Option<f32> {
-        match self {
+    pub fn local_scale(&self) -> Option<f32> {
+        match *self {
             RasterSpace::Local(scale) => Some(scale),
             RasterSpace::Screen => None,
         }
     }
 }
 
 #[repr(u8)]
 #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, MallocSizeOf, PartialEq, Serialize, PeekPoke)]
@@ -1193,18 +1193,18 @@ impl YuvData {
 #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, MallocSizeOf, PartialEq, Serialize, PeekPoke)]
 pub enum YuvFormat {
     NV12 = 0,
     PlanarYCbCr = 1,
     InterleavedYCbCr = 2,
 }
 
 impl YuvFormat {
-    pub fn get_plane_num(self) -> usize {
-        match self {
+    pub fn get_plane_num(&self) -> usize {
+        match *self {
             YuvFormat::NV12 => 2,
             YuvFormat::PlanarYCbCr => 3,
             YuvFormat::InterleavedYCbCr => 1,
         }
     }
 }
 
 #[repr(C)]
--- a/gfx/wr/webrender_api/src/display_list.rs
+++ b/gfx/wr/webrender_api/src/display_list.rs
@@ -1355,17 +1355,17 @@ impl DisplayListBuilder {
     }
 
     pub fn push_filters(
         &mut self,
         filters: &[di::FilterOp],
         filter_datas: &[di::FilterData],
         filter_primitives: &[di::FilterPrimitive],
     ) {
-        if !filters.is_empty() {
+        if filters.len() > 0 {
             self.push_item(&di::DisplayItem::SetFilterOps);
             self.push_iter(filters);
         }
 
         for filter_data in filter_datas {
             let func_types = [
                 filter_data.func_r_type, filter_data.func_g_type,
                 filter_data.func_b_type, filter_data.func_a_type];
--- a/gfx/wr/webrender_api/src/font.rs
+++ b/gfx/wr/webrender_api/src/font.rs
@@ -397,17 +397,16 @@ impl Default for GlyphInstance {
             index: 0,
             point: LayoutPoint::zero(),
         }
     }
 }
 
 impl Eq for GlyphInstance {}
 
-#[cfg_attr(feature = "cargo-clippy", allow(clippy::derive_hash_xor_eq))]
 impl Hash for GlyphInstance {
     fn hash<H: Hasher>(&self, state: &mut H) {
         // Note: this is inconsistent with the Eq impl for -0.0 (don't care).
         self.index.hash(state);
         self.point.x.to_bits().hash(state);
         self.point.y.to_bits().hash(state);
     }
 }
--- a/gfx/wr/webrender_api/src/image.rs
+++ b/gfx/wr/webrender_api/src/image.rs
@@ -41,17 +41,17 @@ impl ImageKey {
 /// This is used as a handle to reference blob images, and can be used as an
 /// image in display items.
 #[repr(C)]
 #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
 pub struct BlobImageKey(pub ImageKey);
 
 impl BlobImageKey {
     /// Interpret this blob image as an image for a display item.
-    pub fn as_image(self) -> ImageKey {
+    pub fn as_image(&self) -> ImageKey {
         self.0
     }
 }
 
 /// An arbitrary identifier for an external image provided by the
 /// application. It must be a unique identifier for each external
 /// image.
 #[repr(C)]
--- a/gfx/wr/webrender_api/src/lib.rs
+++ b/gfx/wr/webrender_api/src/lib.rs
@@ -7,17 +7,17 @@
 //!
 //! This separation allows Servo to parallelize compilation across `webrender`
 //! and other crates that depend on `webrender_api`. So in practice, we put
 //! things in this crate when Servo needs to use them. Firefox depends on the
 //! `webrender` crate directly, and so this distinction is not really relevant
 //! there.
 
 #![cfg_attr(feature = "nightly", feature(nonzero))]
-#![cfg_attr(feature = "cargo-clippy", allow(clippy::float_cmp, clippy::too_many_arguments, clippy::unreadable_literal, clippy::new_without_default))]
+#![cfg_attr(feature = "cargo-clippy", allow(float_cmp, too_many_arguments, unreadable_literal))]
 
 extern crate app_units;
 #[macro_use]
 extern crate bitflags;
 extern crate byteorder;
 #[cfg(feature = "nightly")]
 extern crate core;
 #[cfg(target_os = "macos")]