Backed out changeset 541f044e3e7b (bug 1527325) for webrender bustage CLOSED TREE
authorNoemi Erli <nerli@mozilla.com>
Fri, 15 Feb 2019 20:14:54 +0200
changeset 459573 7a840ae3354dedc8763e261e702ec806f01a560c
parent 459572 541f044e3e7bf9d18bfde826ec55417af09bac20
child 459574 aa6103c8ef0ff2544a48ccd46bcca982ab15b5e8
push id35563
push userccoroiu@mozilla.com
push dateSat, 16 Feb 2019 09:36:04 +0000
treeherdermozilla-central@1cfd69d05aa1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1527325
milestone67.0a1
backs out541f044e3e7bf9d18bfde826ec55417af09bac20
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 changeset 541f044e3e7b (bug 1527325) for webrender bustage CLOSED TREE
gfx/wr/webrender_api/src/api.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/gradient_builder.rs
gfx/wr/webrender_api/src/image.rs
gfx/wr/webrender_api/src/units.rs
--- a/gfx/wr/webrender_api/src/api.rs
+++ b/gfx/wr/webrender_api/src/api.rs
@@ -8,40 +8,39 @@ use app_units::Au;
 use channel::{self, MsgSender, Payload, PayloadSender, PayloadSenderHelperMethods};
 use std::cell::Cell;
 use std::fmt;
 use std::marker::PhantomData;
 use std::os::raw::c_void;
 use std::path::PathBuf;
 use std::sync::Arc;
 use std::u32;
-
-use {display_item as di, font};
-use color::ColorF;
-use display_list::{BuiltDisplayList, BuiltDisplayListDescriptor};
-use image::{BlobImageData, BlobImageKey, ImageData, ImageDescriptor, ImageKey};
-use units::*;
-
+use {BuiltDisplayList, BuiltDisplayListDescriptor, ColorF, DeviceIntPoint, DeviceIntRect};
+use {DeviceIntSize, ExternalScrollId, FontInstanceKey, FontInstanceOptions};
+use {FontInstancePlatformOptions, FontKey, FontVariation, GlyphDimensions, GlyphIndex, ImageData};
+use {ImageDescriptor, ItemTag, LayoutPoint, LayoutSize, LayoutTransform, LayoutVector2D};
+use {BlobDirtyRect, ImageDirtyRect, ImageKey, BlobImageKey, BlobImageData};
+use {NativeFontHandle, WorldPoint};
 
 pub type TileSize = u16;
 /// Documents are rendered in the ascending order of their associated layer values.
 pub type DocumentLayer = i8;
 
 #[derive(Clone, Deserialize, Serialize)]
 pub enum ResourceUpdate {
     AddImage(AddImage),
     UpdateImage(UpdateImage),
     AddBlobImage(AddBlobImage),
     UpdateBlobImage(UpdateBlobImage),
     DeleteImage(ImageKey),
     SetBlobImageVisibleArea(BlobImageKey, DeviceIntRect),
     AddFont(AddFont),
-    DeleteFont(font::FontKey),
+    DeleteFont(FontKey),
     AddFontInstance(AddFontInstance),
-    DeleteFontInstance(font::FontInstanceKey),
+    DeleteFontInstance(FontInstanceKey),
 }
 
 /// A Transaction is a group of commands to apply atomically to a document.
 ///
 /// This mechanism ensures that:
 ///  - no other message can be interleaved between two commands that need to be applied together.
 ///  - no redundant work is performed if two commands in the same transaction cause the scene or
 ///    the frame to be rebuilt.
@@ -220,17 +219,17 @@ impl Transaction {
     /// which has `ScrollPolicy::Scrollable` set.
     pub fn scroll(&mut self, scroll_location: ScrollLocation, cursor: WorldPoint) {
         self.frame_ops.push(FrameMsg::Scroll(scroll_location, cursor));
     }
 
     pub fn scroll_node_with_id(
         &mut self,
         origin: LayoutPoint,
-        id: di::ExternalScrollId,
+        id: ExternalScrollId,
         clamp: ScrollClamping,
     ) {
         self.frame_ops.push(FrameMsg::ScrollNodeWithId(origin, id, clamp));
     }
 
     pub fn set_page_zoom(&mut self, page_zoom: ZoomFactor) {
         self.scene_ops.push(SceneMsg::SetPageZoom(page_zoom));
     }
@@ -376,51 +375,51 @@ impl Transaction {
     pub fn delete_blob_image(&mut self, key: BlobImageKey) {
         self.resource_updates.push(ResourceUpdate::DeleteImage(key.as_image()));
     }
 
     pub fn set_blob_image_visible_area(&mut self, key: BlobImageKey, area: DeviceIntRect) {
         self.resource_updates.push(ResourceUpdate::SetBlobImageVisibleArea(key, area))
     }
 
-    pub fn add_raw_font(&mut self, key: font::FontKey, bytes: Vec<u8>, index: u32) {
+    pub fn add_raw_font(&mut self, key: FontKey, bytes: Vec<u8>, index: u32) {
         self.resource_updates
             .push(ResourceUpdate::AddFont(AddFont::Raw(key, bytes, index)));
     }
 
-    pub fn add_native_font(&mut self, key: font::FontKey, native_handle: font::NativeFontHandle) {
+    pub fn add_native_font(&mut self, key: FontKey, native_handle: NativeFontHandle) {
         self.resource_updates
             .push(ResourceUpdate::AddFont(AddFont::Native(key, native_handle)));
     }
 
-    pub fn delete_font(&mut self, key: font::FontKey) {
+    pub fn delete_font(&mut self, key: FontKey) {
         self.resource_updates.push(ResourceUpdate::DeleteFont(key));
     }
 
     pub fn add_font_instance(
         &mut self,
-        key: font::FontInstanceKey,
-        font_key: font::FontKey,
+        key: FontInstanceKey,
+        font_key: FontKey,
         glyph_size: Au,
-        options: Option<font::FontInstanceOptions>,
-        platform_options: Option<font::FontInstancePlatformOptions>,
-        variations: Vec<font::FontVariation>,
+        options: Option<FontInstanceOptions>,
+        platform_options: Option<FontInstancePlatformOptions>,
+        variations: Vec<FontVariation>,
     ) {
         self.resource_updates
             .push(ResourceUpdate::AddFontInstance(AddFontInstance {
                 key,
                 font_key,
                 glyph_size,
                 options,
                 platform_options,
                 variations,
             }));
     }
 
-    pub fn delete_font_instance(&mut self, key: font::FontInstanceKey) {
+    pub fn delete_font_instance(&mut self, key: FontInstanceKey) {
         self.resource_updates.push(ResourceUpdate::DeleteFontInstance(key));
     }
 
     // A hint that this transaction can be processed at a lower priority. High-
     // priority transactions can jump ahead of regular-priority transactions,
     // but both high- and regular-priority transactions are processed in order
     // relative to other transactions of the same priority.
     pub fn set_low_priority(&mut self, low_priority: bool) {
@@ -525,30 +524,30 @@ pub struct UpdateBlobImage {
     //#[serde(with = "serde_image_data_raw")]
     pub data: Arc<BlobImageData>,
     pub dirty_rect: BlobDirtyRect,
 }
 
 #[derive(Clone, Deserialize, Serialize)]
 pub enum AddFont {
     Raw(
-        font::FontKey,
+        FontKey,
         #[serde(with = "serde_bytes")] Vec<u8>,
         u32
     ),
-    Native(font::FontKey, font::NativeFontHandle),
+    Native(FontKey, NativeFontHandle),
 }
 
 #[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
 pub struct HitTestItem {
     /// The pipeline that the display item that was hit belongs to.
     pub pipeline: PipelineId,
 
     /// The tag of the hit display item.
-    pub tag: di::ItemTag,
+    pub tag: ItemTag,
 
     /// The hit point in the coordinate space of the "viewport" of the display item. The
     /// viewport is the scroll node formed by the root reference frame of the display item's
     /// pipeline.
     pub point_in_viewport: LayoutPoint,
 
     /// The coordinates of the original hit test point relative to the origin of this item.
     /// This is useful for calculating things like text offsets in the client.
@@ -565,22 +564,22 @@ bitflags! {
     pub struct HitTestFlags: u8 {
         const FIND_ALL = 0b00000001;
         const POINT_RELATIVE_TO_PIPELINE_VIEWPORT = 0b00000010;
     }
 }
 
 #[derive(Clone, Deserialize, Serialize)]
 pub struct AddFontInstance {
-    pub key: font::FontInstanceKey,
-    pub font_key: font::FontKey,
+    pub key: FontInstanceKey,
+    pub font_key: FontKey,
     pub glyph_size: Au,
-    pub options: Option<font::FontInstanceOptions>,
-    pub platform_options: Option<font::FontInstancePlatformOptions>,
-    pub variations: Vec<font::FontVariation>,
+    pub options: Option<FontInstanceOptions>,
+    pub platform_options: Option<FontInstancePlatformOptions>,
+    pub variations: Vec<FontVariation>,
 }
 
 // Frame messages affect building the scene.
 #[derive(Clone, Deserialize, Serialize)]
 pub enum SceneMsg {
     UpdateEpoch(PipelineId, Epoch),
     SetPageZoom(ZoomFactor),
     SetRootPipeline(PipelineId),
@@ -604,17 +603,17 @@ pub enum SceneMsg {
 // Frame messages affect frame generation (applied after building the scene).
 #[derive(Clone, Deserialize, Serialize)]
 pub enum FrameMsg {
     UpdateEpoch(PipelineId, Epoch),
     HitTest(Option<PipelineId>, WorldPoint, HitTestFlags, MsgSender<HitTestResult>),
     SetPan(DeviceIntPoint),
     EnableFrameOutput(PipelineId, bool),
     Scroll(ScrollLocation, WorldPoint),
-    ScrollNodeWithId(LayoutPoint, di::ExternalScrollId, ScrollClamping),
+    ScrollNodeWithId(LayoutPoint, ExternalScrollId, ScrollClamping),
     GetScrollNodeState(MsgSender<Vec<ScrollNodeState>>),
     UpdateDynamicProperties(DynamicProperties),
     AppendDynamicProperties(DynamicProperties),
     SetPinchZoom(ZoomFactor),
 }
 
 impl fmt::Debug for SceneMsg {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
@@ -711,22 +710,22 @@ pub enum DebugCommand {
 }
 
 #[derive(Clone, Deserialize, Serialize)]
 pub enum ApiMsg {
     /// Add/remove/update images and fonts.
     UpdateResources(Vec<ResourceUpdate>),
     /// Gets the glyph dimensions
     GetGlyphDimensions(
-        font::FontInstanceKey,
-        Vec<font::GlyphIndex>,
-        MsgSender<Vec<Option<font::GlyphDimensions>>>,
+        FontInstanceKey,
+        Vec<GlyphIndex>,
+        MsgSender<Vec<Option<GlyphDimensions>>>,
     ),
     /// Gets the glyph indices from a string
-    GetGlyphIndices(font::FontKey, String, MsgSender<Vec<Option<u32>>>),
+    GetGlyphIndices(FontKey, String, MsgSender<Vec<Option<u32>>>),
     /// Adds a new document namespace.
     CloneApi(MsgSender<IdNamespace>),
     /// Adds a new document namespace.
     CloneApiByClient(IdNamespace),
     /// Adds a new document with given initial size.
     AddDocument(DocumentId, DeviceIntSize, DocumentLayer),
     /// A message targeted at a particular document.
     UpdateDocument(DocumentId, TransactionMsg),
@@ -1055,45 +1054,45 @@ impl RenderApi {
         document_id
     }
 
     pub fn delete_document(&self, document_id: DocumentId) {
         let msg = ApiMsg::DeleteDocument(document_id);
         self.api_sender.send(msg).unwrap();
     }
 
-    pub fn generate_font_key(&self) -> font::FontKey {
+    pub fn generate_font_key(&self) -> FontKey {
         let new_id = self.next_unique_id();
-        font::FontKey::new(self.namespace_id, new_id)
+        FontKey::new(self.namespace_id, new_id)
     }
 
-    pub fn generate_font_instance_key(&self) -> font::FontInstanceKey {
+    pub fn generate_font_instance_key(&self) -> FontInstanceKey {
         let new_id = self.next_unique_id();
-        font::FontInstanceKey::new(self.namespace_id, new_id)
+        FontInstanceKey::new(self.namespace_id, new_id)
     }
 
     /// Gets the dimensions for the supplied glyph keys
     ///
     /// Note: Internally, the internal texture cache doesn't store
     /// 'empty' textures (height or width = 0)
     /// This means that glyph dimensions e.g. for spaces (' ') will mostly be None.
     pub fn get_glyph_dimensions(
         &self,
-        font: font::FontInstanceKey,
-        glyph_indices: Vec<font::GlyphIndex>,
-    ) -> Vec<Option<font::GlyphDimensions>> {
+        font: FontInstanceKey,
+        glyph_indices: Vec<GlyphIndex>,
+    ) -> Vec<Option<GlyphDimensions>> {
         let (tx, rx) = channel::msg_channel().unwrap();
         let msg = ApiMsg::GetGlyphDimensions(font, glyph_indices, tx);
         self.api_sender.send(msg).unwrap();
         rx.recv().unwrap()
     }
 
     /// Gets the glyph indices for the supplied string. These
     /// can be used to construct GlyphKeys.
-    pub fn get_glyph_indices(&self, font_key: font::FontKey, text: &str) -> Vec<Option<u32>> {
+    pub fn get_glyph_indices(&self, font_key: FontKey, text: &str) -> Vec<Option<u32>> {
         let (tx, rx) = channel::msg_channel().unwrap();
         let msg = ApiMsg::GetGlyphIndices(font_key, text.to_string(), tx);
         self.api_sender.send(msg).unwrap();
         rx.recv().unwrap()
     }
 
     /// Creates an `ImageKey`.
     pub fn generate_image_key(&self) -> ImageKey {
@@ -1288,17 +1287,17 @@ impl Drop for RenderApi {
     fn drop(&mut self) {
         let msg = ApiMsg::ClearNamespace(self.namespace_id);
         let _ = self.api_sender.send(msg);
     }
 }
 
 #[derive(Clone, Deserialize, Serialize)]
 pub struct ScrollNodeState {
-    pub id: di::ExternalScrollId,
+    pub id: ExternalScrollId,
     pub scroll_offset: LayoutVector2D,
 }
 
 #[derive(Clone, Copy, Debug, Deserialize, Serialize)]
 pub enum ScrollLocation {
     /// Scroll by a certain amount.
     Delta(LayoutVector2D),
     /// Scroll to very top of element.
@@ -1308,17 +1307,17 @@ pub enum ScrollLocation {
 }
 
 /// Represents a zoom factor.
 #[derive(Clone, Copy, Serialize, Deserialize, Debug)]
 pub struct ZoomFactor(f32);
 
 impl ZoomFactor {
     /// Construct a new zoom factor.
-    pub fn new(scale: f32) -> Self {
+    pub fn new(scale: f32) -> ZoomFactor {
         ZoomFactor(scale)
     }
 
     /// Get the zoom factor as an untyped float.
     pub fn get(&self) -> f32 {
         self.0
     }
 }
--- a/gfx/wr/webrender_api/src/display_item.rs
+++ b/gfx/wr/webrender_api/src/display_item.rs
@@ -1,20 +1,20 @@
 /* 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/. */
 
+#[cfg(any(feature = "serialize", feature = "deserialize"))]
+use GlyphInstance;
 use euclid::{SideOffsets2D, TypedRect};
 use std::ops::Not;
-
-use font;
-use api::{PipelineId, PropertyBinding};
-use color::ColorF;
-use image::{ColorDepth, ImageKey};
-use units::*;
+use {ColorF, FontInstanceKey, GlyphOptions, ImageKey, LayoutPixel, LayoutPoint};
+use {LayoutRect, LayoutSize, LayoutTransform, LayoutVector2D, PipelineId, PropertyBinding};
+use LayoutSideOffsets;
+use image::ColorDepth;
 
 // Maximum blur radius.
 // Taken from nsCSSRendering.cpp in Gecko.
 pub const MAX_BLUR_RADIUS: f32 = 300.;
 
 // NOTE: some of these structs have an "IMPLICIT" comment.
 // This indicates that the BuiltDisplayList will have serialized
 // a list of values nearby that this item consumes. The traversal
@@ -138,17 +138,17 @@ pub enum SpecificDisplayItem {
 pub enum CompletelySpecificDisplayItem {
     Clip(ClipDisplayItem, Vec<ComplexClipRegion>),
     ClipChain(ClipChainItem, Vec<ClipId>),
     ScrollFrame(ScrollFrameDisplayItem, Vec<ComplexClipRegion>),
     StickyFrame(StickyFrameDisplayItem),
     Rectangle(RectangleDisplayItem),
     ClearRectangle,
     Line(LineDisplayItem),
-    Text(TextDisplayItem, Vec<font::GlyphInstance>),
+    Text(TextDisplayItem, Vec<GlyphInstance>),
     Image(ImageDisplayItem),
     YuvImage(YuvImageDisplayItem),
     Border(BorderDisplayItem),
     BoxShadow(BoxShadowDisplayItem),
     Gradient(GradientDisplayItem),
     RadialGradient(RadialGradientDisplayItem),
     Iframe(IframeDisplayItem),
     PushReferenceFrame(ReferenceFrameDisplayListItem),
@@ -259,20 +259,20 @@ pub enum LineStyle {
     Solid,
     Dotted,
     Dashed,
     Wavy,
 }
 
 #[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
 pub struct TextDisplayItem {
-    pub font_key: font::FontInstanceKey,
+    pub font_key: FontInstanceKey,
     pub color: ColorF,
-    pub glyph_options: Option<font::GlyphOptions>,
-} // IMPLICIT: glyphs: Vec<font::GlyphInstance>
+    pub glyph_options: Option<GlyphOptions>,
+} // IMPLICIT: glyphs: Vec<GlyphInstance>
 
 #[derive(Clone, Copy, Debug, Deserialize, MallocSizeOf, PartialEq, Serialize)]
 pub struct NormalBorder {
     pub left: BorderSide,
     pub right: BorderSide,
     pub top: BorderSide,
     pub bottom: BorderSide,
     pub radius: BorderRadius,
--- a/gfx/wr/webrender_api/src/display_list.rs
+++ b/gfx/wr/webrender_api/src/display_list.rs
@@ -9,25 +9,29 @@ use serde::de::Deserializer;
 #[cfg(feature = "serialize")]
 use serde::ser::{Serializer, SerializeSeq};
 use serde::{Deserialize, Serialize};
 use std::io::{Read, stdout, Write};
 use std::marker::PhantomData;
 use std::ops::Range;
 use std::{io, mem, ptr, slice};
 use time::precise_time_ns;
-
-use display_item as di;
-use api::{PipelineId, PropertyBinding};
-use gradient_builder::GradientBuilder;
-use color::ColorF;
-use font::{FontInstanceKey, GlyphInstance, GlyphOptions};
-use image::{ColorDepth, ImageKey};
-use units::*;
-
+use {AlphaType, BorderDetails, BorderDisplayItem, BorderRadius, BoxShadowClipMode, CacheMarkerDisplayItem};
+use {BoxShadowDisplayItem, ClipChainId, ClipChainItem, ClipDisplayItem, ClipId};
+use {ColorF, ComplexClipRegion, DisplayItem, ExtendMode, ExternalScrollId, FilterOp};
+use {FontInstanceKey, GlyphInstance, GlyphOptions, RasterSpace, Gradient, GradientBuilder};
+use {GradientDisplayItem, GradientStop, IframeDisplayItem, ImageDisplayItem, ImageKey, ImageMask};
+use {ImageRendering, LayoutPoint, LayoutPrimitiveInfo, LayoutRect, LayoutSideOffsets, LayoutSize};
+use {LayoutTransform, LayoutVector2D, LineDisplayItem, LineOrientation, LineStyle, MixBlendMode};
+use {PipelineId, PropertyBinding, ReferenceFrameDisplayListItem};
+use {PushStackingContextDisplayItem, RadialGradient, RadialGradientDisplayItem};
+use {RectangleDisplayItem, ReferenceFrame, ReferenceFrameKind, ScrollFrameDisplayItem, ScrollSensitivity};
+use {SerializedDisplayItem, Shadow, SpaceAndClipInfo, SpatialId, SpecificDisplayItem};
+use {StackingContext, StickyFrameDisplayItem, StickyOffsetBounds};
+use {TextDisplayItem, TransformStyle, YuvColorSpace, YuvData, YuvImageDisplayItem, ColorDepth};
 
 // We don't want to push a long text-run. If a text-run is too long, split it into several parts.
 // This needs to be set to (renderer::MAX_VERTEX_TEXTURE_WIDTH - VECS_PER_TEXT_RUN) * 2
 pub const MAX_TEXT_RUN_LENGTH: usize = 2040;
 
 // See ROOT_REFERENCE_FRAME_SPATIAL_ID and ROOT_SCROLL_NODE_SPATIAL_ID
 // TODO(mrobinson): It would be a good idea to eliminate the root scroll frame which is only
 // used by Servo.
@@ -86,22 +90,22 @@ pub struct BuiltDisplayListDescriptor {
     total_clip_nodes: usize,
     /// The amount of spatial nodes created while building this display list.
     total_spatial_nodes: usize,
 }
 
 pub struct BuiltDisplayListIter<'a> {
     list: &'a BuiltDisplayList,
     data: &'a [u8],
-    cur_item: di::DisplayItem,
-    cur_stops: ItemRange<di::GradientStop>,
+    cur_item: DisplayItem,
+    cur_stops: ItemRange<GradientStop>,
     cur_glyphs: ItemRange<GlyphInstance>,
-    cur_filters: ItemRange<di::FilterOp>,
-    cur_clip_chain_items: ItemRange<di::ClipId>,
-    cur_complex_clip: (ItemRange<di::ComplexClipRegion>, usize),
+    cur_filters: ItemRange<FilterOp>,
+    cur_clip_chain_items: ItemRange<ClipId>,
+    cur_complex_clip: (ItemRange<ComplexClipRegion>, usize),
     peeking: Peek,
 }
 
 pub struct DisplayItemRef<'a: 'b, 'b> {
     iter: &'b BuiltDisplayListIter<'a>,
 }
 
 #[derive(PartialEq)]
@@ -201,21 +205,21 @@ impl<'a> BuiltDisplayListIter<'a> {
     pub fn new(list: &'a BuiltDisplayList) -> Self {
         Self::new_with_list_and_data(list, list.item_slice())
     }
 
     pub fn new_with_list_and_data(list: &'a BuiltDisplayList, data: &'a [u8]) -> Self {
         BuiltDisplayListIter {
             list,
             data,
-            cur_item: di::DisplayItem {
+            cur_item: DisplayItem {
                 // Dummy data, will be overwritten by `next`
-                item: di::SpecificDisplayItem::PopStackingContext,
-                layout: di::LayoutPrimitiveInfo::new(LayoutRect::zero()),
-                space_and_clip: di::SpaceAndClipInfo::root_scroll(PipelineId::dummy())
+                item: SpecificDisplayItem::PopStackingContext,
+                layout: LayoutPrimitiveInfo::new(LayoutRect::zero()),
+                space_and_clip: SpaceAndClipInfo::root_scroll(PipelineId::dummy())
             },
             cur_stops: ItemRange::default(),
             cur_glyphs: ItemRange::default(),
             cur_filters: ItemRange::default(),
             cur_clip_chain_items: ItemRange::default(),
             cur_complex_clip: (ItemRange::default(), 0),
             peeking: Peek::NotPeeking,
         }
@@ -269,132 +273,132 @@ impl<'a> BuiltDisplayListIter<'a> {
         {
             let reader = bincode::IoReader::new(UnsafeReader::new(&mut self.data));
             bincode::deserialize_in_place(reader, &mut self.cur_item)
                 .expect("MEH: malicious process?");
         }
 
         match self.cur_item.item {
             SetGradientStops => {
-                self.cur_stops = skip_slice::<di::GradientStop>(self.list, &mut self.data).0;
+                self.cur_stops = skip_slice::<GradientStop>(self.list, &mut self.data).0;
             }
             ClipChain(_) => {
-                self.cur_clip_chain_items = skip_slice::<di::ClipId>(self.list, &mut self.data).0;
+                self.cur_clip_chain_items = skip_slice::<ClipId>(self.list, &mut self.data).0;
             }
             Clip(_) | ScrollFrame(_) => {
-                self.cur_complex_clip = self.skip_slice::<di::ComplexClipRegion>()
+                self.cur_complex_clip = self.skip_slice::<ComplexClipRegion>()
             }
             Text(_) => self.cur_glyphs = self.skip_slice::<GlyphInstance>().0,
-            PushStackingContext(_) => self.cur_filters = self.skip_slice::<di::FilterOp>().0,
+            PushStackingContext(_) => self.cur_filters = self.skip_slice::<FilterOp>().0,
             _ => { /* do nothing */ }
         }
 
         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)
     }
 
     pub fn as_ref<'b>(&'b self) -> DisplayItemRef<'a, 'b> {
         DisplayItemRef { iter: self }
     }
 
     pub fn starting_stacking_context(
         &mut self,
-    ) -> Option<(di::StackingContext, LayoutRect, ItemRange<di::FilterOp>)> {
+    ) -> Option<(StackingContext, LayoutRect, ItemRange<FilterOp>)> {
         self.next().and_then(|item| match *item.item() {
-            di::SpecificDisplayItem::PushStackingContext(ref specific_item) => Some((
+            SpecificDisplayItem::PushStackingContext(ref specific_item) => Some((
                 specific_item.stacking_context,
                 item.rect(),
                 item.filters(),
             )),
             _ => None,
         })
     }
 
     pub fn skip_current_stacking_context(&mut self) {
         let mut depth = 0;
         while let Some(item) = self.next() {
             match *item.item() {
-                di::SpecificDisplayItem::PushStackingContext(..) => depth += 1,
-                di::SpecificDisplayItem::PopStackingContext if depth == 0 => return,
-                di::SpecificDisplayItem::PopStackingContext => depth -= 1,
+                SpecificDisplayItem::PushStackingContext(..) => depth += 1,
+                SpecificDisplayItem::PopStackingContext if depth == 0 => return,
+                SpecificDisplayItem::PopStackingContext => depth -= 1,
                 _ => {}
             }
             debug_assert!(depth >= 0);
         }
     }
 
     pub fn current_stacking_context_empty(&mut self) -> bool {
         match self.peek() {
-            Some(item) => *item.item() == di::SpecificDisplayItem::PopStackingContext,
+            Some(item) => *item.item() == SpecificDisplayItem::PopStackingContext,
             None => true,
         }
     }
 
     pub fn peek<'b>(&'b mut self) -> Option<DisplayItemRef<'a, 'b>> {
         if self.peeking == Peek::NotPeeking {
             self.peeking = Peek::StartPeeking;
             self.next()
         } else {
             Some(self.as_ref())
         }
     }
 }
 
 // Some of these might just become ItemRanges
 impl<'a, 'b> DisplayItemRef<'a, 'b> {
-    pub fn display_item(&self) -> &di::DisplayItem {
+    pub fn display_item(&self) -> &DisplayItem {
         &self.iter.cur_item
     }
 
     pub fn rect(&self) -> LayoutRect {
         self.iter.cur_item.layout.rect
     }
 
-    pub fn get_layout_primitive_info(&self, offset: &LayoutVector2D) -> di::LayoutPrimitiveInfo {
+    pub fn get_layout_primitive_info(&self, offset: &LayoutVector2D) -> LayoutPrimitiveInfo {
         let layout = self.iter.cur_item.layout;
-        di::LayoutPrimitiveInfo {
+        LayoutPrimitiveInfo {
             rect: layout.rect.translate(offset),
             clip_rect: layout.clip_rect.translate(offset),
             is_backface_visible: layout.is_backface_visible,
             tag: layout.tag,
         }
     }
 
     pub fn clip_rect(&self) -> &LayoutRect {
         &self.iter.cur_item.layout.clip_rect
     }
 
-    pub fn space_and_clip_info(&self) -> &di::SpaceAndClipInfo {
+    pub fn space_and_clip_info(&self) -> &SpaceAndClipInfo {
         &self.iter.cur_item.space_and_clip
     }
 
-    pub fn item(&self) -> &di::SpecificDisplayItem {
+    pub fn item(&self) -> &SpecificDisplayItem {
         &self.iter.cur_item.item
     }
 
-    pub fn complex_clip(&self) -> (ItemRange<di::ComplexClipRegion>, usize) {
+    pub fn complex_clip(&self) -> (ItemRange<ComplexClipRegion>, usize) {
         self.iter.cur_complex_clip
     }
 
-    pub fn gradient_stops(&self) -> ItemRange<di::GradientStop> {
+    pub fn gradient_stops(&self) -> ItemRange<GradientStop> {
         self.iter.cur_stops
     }
 
     pub fn glyphs(&self) -> ItemRange<GlyphInstance> {
         self.iter.cur_glyphs
     }
 
-    pub fn filters(&self) -> ItemRange<di::FilterOp> {
+    pub fn filters(&self) -> ItemRange<FilterOp> {
         self.iter.cur_filters
     }
 
-    pub fn clip_chain_items(&self) -> ItemRange<di::ClipId> {
+    pub fn clip_chain_items(&self) -> ItemRange<ClipId> {
         self.iter.cur_clip_chain_items
     }
 
     pub fn display_list(&self) -> &BuiltDisplayList {
         self.iter.display_list()
     }
 
     pub fn is_backface_visible(&self) -> bool {
@@ -453,57 +457,57 @@ impl Serialize for BuiltDisplayList {
         use display_item::GenericDisplayItem;
 
         let mut seq = serializer.serialize_seq(None)?;
         let mut traversal = self.iter();
         while let Some(item) = traversal.next_raw() {
             let display_item = item.display_item();
             let serial_di = GenericDisplayItem {
                 item: match display_item.item {
-                    di::SpecificDisplayItem::Clip(v) => Clip(
+                    SpecificDisplayItem::Clip(v) => Clip(
                         v,
                         item.iter.list.get(item.iter.cur_complex_clip.0).collect()
                     ),
-                    di::SpecificDisplayItem::ClipChain(v) => ClipChain(
+                    SpecificDisplayItem::ClipChain(v) => ClipChain(
                         v,
                         item.iter.list.get(item.iter.cur_clip_chain_items).collect(),
                     ),
-                    di::SpecificDisplayItem::ScrollFrame(v) => ScrollFrame(
+                    SpecificDisplayItem::ScrollFrame(v) => ScrollFrame(
                         v,
                         item.iter.list.get(item.iter.cur_complex_clip.0).collect()
                     ),
-                    di::SpecificDisplayItem::StickyFrame(v) => StickyFrame(v),
-                    di::SpecificDisplayItem::Rectangle(v) => Rectangle(v),
-                    di::SpecificDisplayItem::ClearRectangle => ClearRectangle,
-                    di::SpecificDisplayItem::Line(v) => Line(v),
-                    di::SpecificDisplayItem::Text(v) => Text(
+                    SpecificDisplayItem::StickyFrame(v) => StickyFrame(v),
+                    SpecificDisplayItem::Rectangle(v) => Rectangle(v),
+                    SpecificDisplayItem::ClearRectangle => ClearRectangle,
+                    SpecificDisplayItem::Line(v) => Line(v),
+                    SpecificDisplayItem::Text(v) => Text(
                         v,
                         item.iter.list.get(item.iter.cur_glyphs).collect()
                     ),
-                    di::SpecificDisplayItem::Image(v) => Image(v),
-                    di::SpecificDisplayItem::YuvImage(v) => YuvImage(v),
-                    di::SpecificDisplayItem::Border(v) => Border(v),
-                    di::SpecificDisplayItem::BoxShadow(v) => BoxShadow(v),
-                    di::SpecificDisplayItem::Gradient(v) => Gradient(v),
-                    di::SpecificDisplayItem::RadialGradient(v) => RadialGradient(v),
-                    di::SpecificDisplayItem::Iframe(v) => Iframe(v),
-                    di::SpecificDisplayItem::PushReferenceFrame(v) => PushReferenceFrame(v),
-                    di::SpecificDisplayItem::PopReferenceFrame => PopReferenceFrame,
-                    di::SpecificDisplayItem::PushStackingContext(v) => PushStackingContext(
+                    SpecificDisplayItem::Image(v) => Image(v),
+                    SpecificDisplayItem::YuvImage(v) => YuvImage(v),
+                    SpecificDisplayItem::Border(v) => Border(v),
+                    SpecificDisplayItem::BoxShadow(v) => BoxShadow(v),
+                    SpecificDisplayItem::Gradient(v) => Gradient(v),
+                    SpecificDisplayItem::RadialGradient(v) => RadialGradient(v),
+                    SpecificDisplayItem::Iframe(v) => Iframe(v),
+                    SpecificDisplayItem::PushReferenceFrame(v) => PushReferenceFrame(v),
+                    SpecificDisplayItem::PopReferenceFrame => PopReferenceFrame,
+                    SpecificDisplayItem::PushStackingContext(v) => PushStackingContext(
                         v,
                         item.iter.list.get(item.iter.cur_filters).collect()
                     ),
-                    di::SpecificDisplayItem::PopStackingContext => PopStackingContext,
-                    di::SpecificDisplayItem::SetGradientStops => SetGradientStops(
+                    SpecificDisplayItem::PopStackingContext => PopStackingContext,
+                    SpecificDisplayItem::SetGradientStops => SetGradientStops(
                         item.iter.list.get(item.iter.cur_stops).collect()
                     ),
-                    di::SpecificDisplayItem::PushShadow(v) => PushShadow(v),
-                    di::SpecificDisplayItem::PopAllShadows => PopAllShadows,
-                    di::SpecificDisplayItem::PushCacheMarker(m) => PushCacheMarker(m),
-                    di::SpecificDisplayItem::PopCacheMarker => PopCacheMarker,
+                    SpecificDisplayItem::PushShadow(v) => PushShadow(v),
+                    SpecificDisplayItem::PopAllShadows => PopAllShadows,
+                    SpecificDisplayItem::PushCacheMarker(m) => PushCacheMarker(m),
+                    SpecificDisplayItem::PopCacheMarker => PopCacheMarker,
                 },
                 layout: display_item.layout,
                 space_and_clip: display_item.space_and_clip,
             };
             seq.serialize_element(&serial_di)?
         }
         seq.end()
     }
@@ -525,73 +529,73 @@ impl<'de> Deserialize<'de> for BuiltDisp
         let list = Vec::<GenericDisplayItem<CompletelySpecificDisplayItem>>
             ::deserialize(deserializer)?;
 
         let mut data = Vec::new();
         let mut temp = Vec::new();
         let mut total_clip_nodes = FIRST_CLIP_NODE_INDEX;
         let mut total_spatial_nodes = FIRST_SPATIAL_NODE_INDEX;
         for complete in list {
-            let item = di::DisplayItem {
+            let item = DisplayItem {
                 item: match complete.item {
                     Clip(specific_item, complex_clips) => {
                         total_clip_nodes += 1;
                         DisplayListBuilder::push_iter_impl(&mut temp, complex_clips);
-                        di::SpecificDisplayItem::Clip(specific_item)
+                        SpecificDisplayItem::Clip(specific_item)
                     },
                     ClipChain(specific_item, clip_chain_ids) => {
                         DisplayListBuilder::push_iter_impl(&mut temp, clip_chain_ids);
-                        di::SpecificDisplayItem::ClipChain(specific_item)
+                        SpecificDisplayItem::ClipChain(specific_item)
                     }
                     ScrollFrame(specific_item, complex_clips) => {
                         total_spatial_nodes += 1;
                         total_clip_nodes += 1;
                         DisplayListBuilder::push_iter_impl(&mut temp, complex_clips);
-                        di::SpecificDisplayItem::ScrollFrame(specific_item)
+                        SpecificDisplayItem::ScrollFrame(specific_item)
                     }
                     StickyFrame(specific_item) => {
                         total_spatial_nodes += 1;
-                        di::SpecificDisplayItem::StickyFrame(specific_item)
+                        SpecificDisplayItem::StickyFrame(specific_item)
                     }
-                    Rectangle(specific_item) => di::SpecificDisplayItem::Rectangle(specific_item),
-                    ClearRectangle => di::SpecificDisplayItem::ClearRectangle,
-                    Line(specific_item) => di::SpecificDisplayItem::Line(specific_item),
+                    Rectangle(specific_item) => SpecificDisplayItem::Rectangle(specific_item),
+                    ClearRectangle => SpecificDisplayItem::ClearRectangle,
+                    Line(specific_item) => SpecificDisplayItem::Line(specific_item),
                     Text(specific_item, glyphs) => {
                         DisplayListBuilder::push_iter_impl(&mut temp, glyphs);
-                        di::SpecificDisplayItem::Text(specific_item)
+                        SpecificDisplayItem::Text(specific_item)
                     },
-                    Image(specific_item) => di::SpecificDisplayItem::Image(specific_item),
-                    YuvImage(specific_item) => di::SpecificDisplayItem::YuvImage(specific_item),
-                    Border(specific_item) => di::SpecificDisplayItem::Border(specific_item),
-                    BoxShadow(specific_item) => di::SpecificDisplayItem::BoxShadow(specific_item),
-                    Gradient(specific_item) => di::SpecificDisplayItem::Gradient(specific_item),
+                    Image(specific_item) => SpecificDisplayItem::Image(specific_item),
+                    YuvImage(specific_item) => SpecificDisplayItem::YuvImage(specific_item),
+                    Border(specific_item) => SpecificDisplayItem::Border(specific_item),
+                    BoxShadow(specific_item) => SpecificDisplayItem::BoxShadow(specific_item),
+                    Gradient(specific_item) => SpecificDisplayItem::Gradient(specific_item),
                     RadialGradient(specific_item) =>
-                        di::SpecificDisplayItem::RadialGradient(specific_item),
+                        SpecificDisplayItem::RadialGradient(specific_item),
                     Iframe(specific_item) => {
                         total_clip_nodes += 1;
-                        di::SpecificDisplayItem::Iframe(specific_item)
+                        SpecificDisplayItem::Iframe(specific_item)
                     }
                     PushReferenceFrame(v) => {
                         total_spatial_nodes += 1;
-                        di::SpecificDisplayItem::PushReferenceFrame(v)
+                        SpecificDisplayItem::PushReferenceFrame(v)
                     }
-                    PopReferenceFrame => di::SpecificDisplayItem::PopReferenceFrame,
+                    PopReferenceFrame => SpecificDisplayItem::PopReferenceFrame,
                     PushStackingContext(specific_item, filters) => {
                         DisplayListBuilder::push_iter_impl(&mut temp, filters);
-                        di::SpecificDisplayItem::PushStackingContext(specific_item)
+                        SpecificDisplayItem::PushStackingContext(specific_item)
                     },
-                    PopStackingContext => di::SpecificDisplayItem::PopStackingContext,
+                    PopStackingContext => SpecificDisplayItem::PopStackingContext,
                     SetGradientStops(stops) => {
                         DisplayListBuilder::push_iter_impl(&mut temp, stops);
-                        di::SpecificDisplayItem::SetGradientStops
+                        SpecificDisplayItem::SetGradientStops
                     },
-                    PushShadow(specific_item) => di::SpecificDisplayItem::PushShadow(specific_item),
-                    PopAllShadows => di::SpecificDisplayItem::PopAllShadows,
-                    PushCacheMarker(marker) => di::SpecificDisplayItem::PushCacheMarker(marker),
-                    PopCacheMarker => di::SpecificDisplayItem::PopCacheMarker,
+                    PushShadow(specific_item) => SpecificDisplayItem::PushShadow(specific_item),
+                    PopAllShadows => SpecificDisplayItem::PopAllShadows,
+                    PushCacheMarker(marker) => SpecificDisplayItem::PushCacheMarker(marker),
+                    PopCacheMarker => SpecificDisplayItem::PopCacheMarker,
                 },
                 layout: complete.layout,
                 space_and_clip: complete.space_and_clip,
             };
             serialize_fast(&mut data, &item);
             // the aux data is serialized after the item, hence the temporary
             data.extend(temp.drain(..));
         }
@@ -955,37 +959,37 @@ impl DisplayListBuilder {
     /// Add an item to the display list.
     ///
     /// NOTE: It is usually preferable to use the specialized methods to push
     /// display items. Pushing unexpected or invalid items here may
     /// result in WebRender panicking or behaving in unexpected ways.
     #[inline]
     pub fn push_item(
         &mut self,
-        item: &di::SpecificDisplayItem,
-        layout: &di::LayoutPrimitiveInfo,
-        space_and_clip: &di::SpaceAndClipInfo,
+        item: &SpecificDisplayItem,
+        layout: &LayoutPrimitiveInfo,
+        space_and_clip: &SpaceAndClipInfo,
     ) {
         serialize_fast(
             &mut self.data,
-            di::SerializedDisplayItem {
+            SerializedDisplayItem {
                 item,
                 layout,
                 space_and_clip,
             },
         )
     }
 
     #[inline]
-    fn push_new_empty_item(&mut self, item: &di::SpecificDisplayItem) {
+    fn push_new_empty_item(&mut self, item: &SpecificDisplayItem) {
         let pipeline_id = self.pipeline_id;
         self.push_item(
             item,
-            &di::LayoutPrimitiveInfo::new(LayoutRect::zero()),
-            &di::SpaceAndClipInfo::root_scroll(pipeline_id),
+            &LayoutPrimitiveInfo::new(LayoutRect::zero()),
+            &SpaceAndClipInfo::root_scroll(pipeline_id),
         )
     }
 
     fn push_iter_impl<I>(data: &mut Vec<u8>, iter_source: I)
     where
         I: IntoIterator,
         I::IntoIter: ExactSizeIterator + Clone,
         I::Item: Serialize,
@@ -1026,103 +1030,103 @@ impl DisplayListBuilder {
         I::IntoIter: ExactSizeIterator + Clone,
         I::Item: Serialize,
     {
         Self::push_iter_impl(&mut self.data, iter);
     }
 
     pub fn push_rect(
         &mut self,
-        layout: &di::LayoutPrimitiveInfo,
-        space_and_clip: &di::SpaceAndClipInfo,
+        layout: &LayoutPrimitiveInfo,
+        space_and_clip: &SpaceAndClipInfo,
         color: ColorF,
     ) {
-        let item = di::SpecificDisplayItem::Rectangle(di::RectangleDisplayItem { color });
+        let item = SpecificDisplayItem::Rectangle(RectangleDisplayItem { color });
         self.push_item(&item, layout, space_and_clip);
     }
 
     pub fn push_clear_rect(
         &mut self,
-        layout: &di::LayoutPrimitiveInfo,
-        space_and_clip: &di::SpaceAndClipInfo,
+        layout: &LayoutPrimitiveInfo,
+        space_and_clip: &SpaceAndClipInfo,
     ) {
-        self.push_item(&di::SpecificDisplayItem::ClearRectangle, layout, space_and_clip);
+        self.push_item(&SpecificDisplayItem::ClearRectangle, layout, space_and_clip);
     }
 
     pub fn push_line(
         &mut self,
-        layout: &di::LayoutPrimitiveInfo,
-        space_and_clip: &di::SpaceAndClipInfo,
+        layout: &LayoutPrimitiveInfo,
+        space_and_clip: &SpaceAndClipInfo,
         wavy_line_thickness: f32,
-        orientation: di::LineOrientation,
+        orientation: LineOrientation,
         color: &ColorF,
-        style: di::LineStyle,
+        style: LineStyle,
     ) {
-        let item = di::SpecificDisplayItem::Line(di::LineDisplayItem {
+        let item = SpecificDisplayItem::Line(LineDisplayItem {
             wavy_line_thickness,
             orientation,
             color: *color,
             style,
         });
 
         self.push_item(&item, layout, space_and_clip);
     }
 
     pub fn push_image(
         &mut self,
-        layout: &di::LayoutPrimitiveInfo,
-        space_and_clip: &di::SpaceAndClipInfo,
+        layout: &LayoutPrimitiveInfo,
+        space_and_clip: &SpaceAndClipInfo,
         stretch_size: LayoutSize,
         tile_spacing: LayoutSize,
-        image_rendering: di::ImageRendering,
-        alpha_type: di::AlphaType,
+        image_rendering: ImageRendering,
+        alpha_type: AlphaType,
         key: ImageKey,
         color: ColorF,
     ) {
-        let item = di::SpecificDisplayItem::Image(di::ImageDisplayItem {
+        let item = SpecificDisplayItem::Image(ImageDisplayItem {
             image_key: key,
             stretch_size,
             tile_spacing,
             image_rendering,
             alpha_type,
             color,
         });
 
         self.push_item(&item, layout, space_and_clip);
     }
 
     /// Push a yuv image. All planar data in yuv image should use the same buffer type.
     pub fn push_yuv_image(
         &mut self,
-        layout: &di::LayoutPrimitiveInfo,
-        space_and_clip: &di::SpaceAndClipInfo,
-        yuv_data: di::YuvData,
+        layout: &LayoutPrimitiveInfo,
+        space_and_clip: &SpaceAndClipInfo,
+        yuv_data: YuvData,
         color_depth: ColorDepth,
-        color_space: di::YuvColorSpace,
-        image_rendering: di::ImageRendering,
+        color_space: YuvColorSpace,
+        image_rendering: ImageRendering,
     ) {
-        let item = di::SpecificDisplayItem::YuvImage(di::YuvImageDisplayItem {
+        let item = SpecificDisplayItem::YuvImage(YuvImageDisplayItem {
             yuv_data,
             color_depth,
             color_space,
             image_rendering,
         });
         self.push_item(&item, layout, space_and_clip);
     }
 
     pub fn push_text(
         &mut self,
-        layout: &di::LayoutPrimitiveInfo,
-        space_and_clip: &di::SpaceAndClipInfo,
+        layout: &LayoutPrimitiveInfo,
+        space_and_clip: &SpaceAndClipInfo,
         glyphs: &[GlyphInstance],
         font_key: FontInstanceKey,
         color: ColorF,
         glyph_options: Option<GlyphOptions>,
     ) {
-        let item = di::SpecificDisplayItem::Text(di::TextDisplayItem {
+        let item = SpecificDisplayItem::Text(TextDisplayItem {
             color,
             font_key,
             glyph_options,
         });
 
         for split_glyphs in glyphs.chunks(MAX_TEXT_RUN_LENGTH) {
             self.push_item(&item, layout, space_and_clip);
             self.push_iter(split_glyphs);
@@ -1130,65 +1134,65 @@ impl DisplayListBuilder {
     }
 
     /// NOTE: gradients must be pushed in the order they're created
     /// because create_gradient stores the stops in anticipation.
     pub fn create_gradient(
         &mut self,
         start_point: LayoutPoint,
         end_point: LayoutPoint,
-        stops: Vec<di::GradientStop>,
-        extend_mode: di::ExtendMode,
-    ) -> di::Gradient {
+        stops: Vec<GradientStop>,
+        extend_mode: ExtendMode,
+    ) -> Gradient {
         let mut builder = GradientBuilder::with_stops(stops);
         let gradient = builder.gradient(start_point, end_point, extend_mode);
         self.push_stops(builder.stops());
         gradient
     }
 
     /// NOTE: gradients must be pushed in the order they're created
     /// because create_gradient stores the stops in anticipation.
     pub fn create_radial_gradient(
         &mut self,
         center: LayoutPoint,
         radius: LayoutSize,
-        stops: Vec<di::GradientStop>,
-        extend_mode: di::ExtendMode,
-    ) -> di::RadialGradient {
+        stops: Vec<GradientStop>,
+        extend_mode: ExtendMode,
+    ) -> RadialGradient {
         let mut builder = GradientBuilder::with_stops(stops);
         let gradient = builder.radial_gradient(center, radius, extend_mode);
         self.push_stops(builder.stops());
         gradient
     }
 
     pub fn push_border(
         &mut self,
-        layout: &di::LayoutPrimitiveInfo,
-        space_and_clip: &di::SpaceAndClipInfo,
+        layout: &LayoutPrimitiveInfo,
+        space_and_clip: &SpaceAndClipInfo,
         widths: LayoutSideOffsets,
-        details: di::BorderDetails,
+        details: BorderDetails,
     ) {
-        let item = di::SpecificDisplayItem::Border(di::BorderDisplayItem { details, widths });
+        let item = SpecificDisplayItem::Border(BorderDisplayItem { details, widths });
 
         self.push_item(&item, layout, space_and_clip);
     }
 
     pub fn push_box_shadow(
         &mut self,
-        layout: &di::LayoutPrimitiveInfo,
-        space_and_clip: &di::SpaceAndClipInfo,
+        layout: &LayoutPrimitiveInfo,
+        space_and_clip: &SpaceAndClipInfo,
         box_bounds: LayoutRect,
         offset: LayoutVector2D,
         color: ColorF,
         blur_radius: f32,
         spread_radius: f32,
-        border_radius: di::BorderRadius,
-        clip_mode: di::BoxShadowClipMode,
+        border_radius: BorderRadius,
+        clip_mode: BoxShadowClipMode,
     ) {
-        let item = di::SpecificDisplayItem::BoxShadow(di::BoxShadowDisplayItem {
+        let item = SpecificDisplayItem::BoxShadow(BoxShadowDisplayItem {
             box_bounds,
             offset,
             color,
             blur_radius,
             spread_radius,
             border_radius,
             clip_mode,
         });
@@ -1207,310 +1211,310 @@ impl DisplayListBuilder {
     /// are inserted between the tiles as seams.
     ///
     /// The origin of the tiles is given in `layout.rect.origin`.
     /// If the gradient should only be displayed once limit
     /// the `layout.rect.size` to a single tile.
     /// The gradient is only visible within the local clip.
     pub fn push_gradient(
         &mut self,
-        layout: &di::LayoutPrimitiveInfo,
-        space_and_clip: &di::SpaceAndClipInfo,
-        gradient: di::Gradient,
+        layout: &LayoutPrimitiveInfo,
+        space_and_clip: &SpaceAndClipInfo,
+        gradient: Gradient,
         tile_size: LayoutSize,
         tile_spacing: LayoutSize,
     ) {
-        let item = di::SpecificDisplayItem::Gradient(di::GradientDisplayItem {
+        let item = SpecificDisplayItem::Gradient(GradientDisplayItem {
             gradient,
             tile_size,
             tile_spacing,
         });
 
         self.push_item(&item, layout, space_and_clip);
     }
 
     /// Pushes a radial gradient to be displayed.
     ///
     /// See [`push_gradient`](#method.push_gradient) for explanation.
     pub fn push_radial_gradient(
         &mut self,
-        layout: &di::LayoutPrimitiveInfo,
-        space_and_clip: &di::SpaceAndClipInfo,
-        gradient: di::RadialGradient,
+        layout: &LayoutPrimitiveInfo,
+        space_and_clip: &SpaceAndClipInfo,
+        gradient: RadialGradient,
         tile_size: LayoutSize,
         tile_spacing: LayoutSize,
     ) {
-        let item = di::SpecificDisplayItem::RadialGradient(di::RadialGradientDisplayItem {
+        let item = SpecificDisplayItem::RadialGradient(RadialGradientDisplayItem {
             gradient,
             tile_size,
             tile_spacing,
         });
 
         self.push_item(&item, layout, space_and_clip);
     }
 
     pub fn push_reference_frame(
         &mut self,
         rect: &LayoutRect,
-        parent: di::SpatialId,
-        transform_style: di::TransformStyle,
+        parent: SpatialId,
+        transform_style: TransformStyle,
         transform: PropertyBinding<LayoutTransform>,
-        kind: di::ReferenceFrameKind,
-    ) -> di::SpatialId {
+        kind: ReferenceFrameKind,
+    ) -> SpatialId {
         let id = self.generate_spatial_index();
 
-        let item = di::SpecificDisplayItem::PushReferenceFrame(di::ReferenceFrameDisplayListItem {
-            reference_frame: di::ReferenceFrame {
+        let item = SpecificDisplayItem::PushReferenceFrame(ReferenceFrameDisplayListItem {
+            reference_frame: ReferenceFrame {
                 transform_style,
                 transform,
                 kind,
                 id,
             },
         });
 
-        let layout = di::LayoutPrimitiveInfo::new(*rect);
-        self.push_item(&item, &layout, &di::SpaceAndClipInfo {
+        let layout = LayoutPrimitiveInfo::new(*rect);
+        self.push_item(&item, &layout, &SpaceAndClipInfo {
             spatial_id: parent,
-            clip_id: di::ClipId::invalid(),
+            clip_id: ClipId::invalid(),
         });
         id
     }
 
     pub fn push_cache_marker(&mut self) {
-        self.push_new_empty_item(&di::SpecificDisplayItem::PushCacheMarker(di::CacheMarkerDisplayItem {
+        self.push_new_empty_item(&SpecificDisplayItem::PushCacheMarker(CacheMarkerDisplayItem {
             // The display item itself is empty for now while we experiment with
             // the API. In future it may contain extra information, such as details
             // on whether the surface is known to be opaque and/or a background color
             // hint that WR should clear the surface to.
         }));
     }
 
     pub fn pop_cache_marker(&mut self) {
-        self.push_new_empty_item(&di::SpecificDisplayItem::PopCacheMarker);
+        self.push_new_empty_item(&SpecificDisplayItem::PopCacheMarker);
     }
 
     pub fn pop_reference_frame(&mut self) {
-        self.push_new_empty_item(&di::SpecificDisplayItem::PopReferenceFrame);
+        self.push_new_empty_item(&SpecificDisplayItem::PopReferenceFrame);
     }
 
     pub fn push_stacking_context(
         &mut self,
-        layout: &di::LayoutPrimitiveInfo,
-        spatial_id: di::SpatialId,
-        clip_id: Option<di::ClipId>,
-        transform_style: di::TransformStyle,
-        mix_blend_mode: di::MixBlendMode,
-        filters: &[di::FilterOp],
-        raster_space: di::RasterSpace,
+        layout: &LayoutPrimitiveInfo,
+        spatial_id: SpatialId,
+        clip_id: Option<ClipId>,
+        transform_style: TransformStyle,
+        mix_blend_mode: MixBlendMode,
+        filters: &[FilterOp],
+        raster_space: RasterSpace,
         cache_tiles: bool,
     ) {
-        let item = di::SpecificDisplayItem::PushStackingContext(di::PushStackingContextDisplayItem {
-            stacking_context: di::StackingContext {
+        let item = SpecificDisplayItem::PushStackingContext(PushStackingContextDisplayItem {
+            stacking_context: StackingContext {
                 transform_style,
                 mix_blend_mode,
                 clip_id,
                 raster_space,
                 cache_tiles,
             },
         });
 
-        self.push_item(&item, layout, &di::SpaceAndClipInfo {
+        self.push_item(&item, layout, &SpaceAndClipInfo {
             spatial_id,
-            clip_id: di::ClipId::invalid(),
+            clip_id: ClipId::invalid(),
         });
         self.push_iter(filters);
     }
 
     /// Helper for examples/ code.
     pub fn push_simple_stacking_context(
         &mut self,
-        layout: &di::LayoutPrimitiveInfo,
-        spatial_id: di::SpatialId,
+        layout: &LayoutPrimitiveInfo,
+        spatial_id: SpatialId,
     ) {
         self.push_simple_stacking_context_with_filters(layout, spatial_id, &[]);
     }
 
     /// Helper for examples/ code.
     pub fn push_simple_stacking_context_with_filters(
         &mut self,
-        layout: &di::LayoutPrimitiveInfo,
-        spatial_id: di::SpatialId,
-        filters: &[di::FilterOp],
+        layout: &LayoutPrimitiveInfo,
+        spatial_id: SpatialId,
+        filters: &[FilterOp],
     ) {
         self.push_stacking_context(
             layout,
             spatial_id,
             None,
-            di::TransformStyle::Flat,
-            di::MixBlendMode::Normal,
+            TransformStyle::Flat,
+            MixBlendMode::Normal,
             filters,
-            di::RasterSpace::Screen,
+            RasterSpace::Screen,
             /* cache_tiles = */ false,
         );
     }
 
     pub fn pop_stacking_context(&mut self) {
-        self.push_new_empty_item(&di::SpecificDisplayItem::PopStackingContext);
+        self.push_new_empty_item(&SpecificDisplayItem::PopStackingContext);
     }
 
-    pub fn push_stops(&mut self, stops: &[di::GradientStop]) {
+    pub fn push_stops(&mut self, stops: &[GradientStop]) {
         if stops.is_empty() {
             return;
         }
-        self.push_new_empty_item(&di::SpecificDisplayItem::SetGradientStops);
+        self.push_new_empty_item(&SpecificDisplayItem::SetGradientStops);
         self.push_iter(stops);
     }
 
-    fn generate_clip_index(&mut self) -> di::ClipId {
+    fn generate_clip_index(&mut self) -> ClipId {
         self.next_clip_index += 1;
-        di::ClipId::Clip(self.next_clip_index - 1, self.pipeline_id)
+        ClipId::Clip(self.next_clip_index - 1, self.pipeline_id)
     }
 
-    fn generate_spatial_index(&mut self) -> di::SpatialId {
+    fn generate_spatial_index(&mut self) -> SpatialId {
         self.next_spatial_index += 1;
-        di::SpatialId::new(self.next_spatial_index - 1, self.pipeline_id)
+        SpatialId::new(self.next_spatial_index - 1, self.pipeline_id)
     }
 
-    fn generate_clip_chain_id(&mut self) -> di::ClipChainId {
+    fn generate_clip_chain_id(&mut self) -> ClipChainId {
         self.next_clip_chain_id += 1;
-        di::ClipChainId(self.next_clip_chain_id - 1, self.pipeline_id)
+        ClipChainId(self.next_clip_chain_id - 1, self.pipeline_id)
     }
 
     pub fn define_scroll_frame<I>(
         &mut self,
-        parent_space_and_clip: &di::SpaceAndClipInfo,
-        external_id: Option<di::ExternalScrollId>,
+        parent_space_and_clip: &SpaceAndClipInfo,
+        external_id: Option<ExternalScrollId>,
         content_rect: LayoutRect,
         clip_rect: LayoutRect,
         complex_clips: I,
-        image_mask: Option<di::ImageMask>,
-        scroll_sensitivity: di::ScrollSensitivity,
-    ) -> di::SpaceAndClipInfo
+        image_mask: Option<ImageMask>,
+        scroll_sensitivity: ScrollSensitivity,
+    ) -> SpaceAndClipInfo
     where
-        I: IntoIterator<Item = di::ComplexClipRegion>,
+        I: IntoIterator<Item = ComplexClipRegion>,
         I::IntoIter: ExactSizeIterator + Clone,
     {
         let clip_id = self.generate_clip_index();
         let scroll_frame_id = self.generate_spatial_index();
-        let item = di::SpecificDisplayItem::ScrollFrame(di::ScrollFrameDisplayItem {
+        let item = SpecificDisplayItem::ScrollFrame(ScrollFrameDisplayItem {
             clip_id,
             scroll_frame_id,
             external_id,
             image_mask,
             scroll_sensitivity,
         });
 
         self.push_item(
             &item,
-            &di::LayoutPrimitiveInfo::with_clip_rect(content_rect, clip_rect),
+            &LayoutPrimitiveInfo::with_clip_rect(content_rect, clip_rect),
             parent_space_and_clip,
         );
         self.push_iter(complex_clips);
 
-        di::SpaceAndClipInfo {
+        SpaceAndClipInfo {
             spatial_id: scroll_frame_id,
             clip_id,
         }
     }
 
     pub fn define_clip_chain<I>(
         &mut self,
-        parent: Option<di::ClipChainId>,
+        parent: Option<ClipChainId>,
         clips: I,
-    ) -> di::ClipChainId
+    ) -> ClipChainId
     where
-        I: IntoIterator<Item = di::ClipId>,
+        I: IntoIterator<Item = ClipId>,
         I::IntoIter: ExactSizeIterator + Clone,
     {
         let id = self.generate_clip_chain_id();
-        self.push_new_empty_item(&di::SpecificDisplayItem::ClipChain(di::ClipChainItem { id, parent }));
+        self.push_new_empty_item(&SpecificDisplayItem::ClipChain(ClipChainItem { id, parent }));
         self.push_iter(clips);
         id
     }
 
     pub fn define_clip<I>(
         &mut self,
-        parent_space_and_clip: &di::SpaceAndClipInfo,
+        parent_space_and_clip: &SpaceAndClipInfo,
         clip_rect: LayoutRect,
         complex_clips: I,
-        image_mask: Option<di::ImageMask>,
-    ) -> di::ClipId
+        image_mask: Option<ImageMask>,
+    ) -> ClipId
     where
-        I: IntoIterator<Item = di::ComplexClipRegion>,
+        I: IntoIterator<Item = ComplexClipRegion>,
         I::IntoIter: ExactSizeIterator + Clone,
     {
         let id = self.generate_clip_index();
-        let item = di::SpecificDisplayItem::Clip(di::ClipDisplayItem {
+        let item = SpecificDisplayItem::Clip(ClipDisplayItem {
             id,
             image_mask,
         });
 
         self.push_item(
             &item,
-            &di::LayoutPrimitiveInfo::new(clip_rect),
+            &LayoutPrimitiveInfo::new(clip_rect),
             parent_space_and_clip,
         );
         self.push_iter(complex_clips);
         id
     }
 
     pub fn define_sticky_frame(
         &mut self,
-        parent_spatial_id: di::SpatialId,
+        parent_spatial_id: SpatialId,
         frame_rect: LayoutRect,
         margins: SideOffsets2D<Option<f32>>,
-        vertical_offset_bounds: di::StickyOffsetBounds,
-        horizontal_offset_bounds: di::StickyOffsetBounds,
+        vertical_offset_bounds: StickyOffsetBounds,
+        horizontal_offset_bounds: StickyOffsetBounds,
         previously_applied_offset: LayoutVector2D,
-    ) -> di::SpatialId {
+    ) -> SpatialId {
         let id = self.generate_spatial_index();
-        let item = di::SpecificDisplayItem::StickyFrame(di::StickyFrameDisplayItem {
+        let item = SpecificDisplayItem::StickyFrame(StickyFrameDisplayItem {
             id,
             margins,
             vertical_offset_bounds,
             horizontal_offset_bounds,
             previously_applied_offset,
         });
 
         self.push_item(
             &item,
-            &di::LayoutPrimitiveInfo::new(frame_rect),
-            &di::SpaceAndClipInfo {
+            &LayoutPrimitiveInfo::new(frame_rect),
+            &SpaceAndClipInfo {
                 spatial_id: parent_spatial_id,
-                clip_id: di::ClipId::invalid(),
+                clip_id: ClipId::invalid(),
             },
         );
         id
     }
 
     pub fn push_iframe(
         &mut self,
-        layout: &di::LayoutPrimitiveInfo,
-        space_and_clip: &di::SpaceAndClipInfo,
+        layout: &LayoutPrimitiveInfo,
+        space_and_clip: &SpaceAndClipInfo,
         pipeline_id: PipelineId,
         ignore_missing_pipeline: bool
     ) {
-        let item = di::SpecificDisplayItem::Iframe(di::IframeDisplayItem {
+        let item = SpecificDisplayItem::Iframe(IframeDisplayItem {
             pipeline_id,
             ignore_missing_pipeline,
         });
         self.push_item(&item, layout, space_and_clip);
     }
 
     pub fn push_shadow(
         &mut self,
-        layout: &di::LayoutPrimitiveInfo,
-        space_and_clip: &di::SpaceAndClipInfo,
-        shadow: di::Shadow,
+        layout: &LayoutPrimitiveInfo,
+        space_and_clip: &SpaceAndClipInfo,
+        shadow: Shadow,
     ) {
-        self.push_item(&di::SpecificDisplayItem::PushShadow(shadow), layout, space_and_clip);
+        self.push_item(&SpecificDisplayItem::PushShadow(shadow), layout, space_and_clip);
     }
 
     pub fn pop_all_shadows(&mut self) {
-        self.push_new_empty_item(&di::SpecificDisplayItem::PopAllShadows);
+        self.push_new_empty_item(&SpecificDisplayItem::PopAllShadows);
     }
 
     pub fn finalize(self) -> (PipelineId, LayoutSize, BuiltDisplayList) {
         assert!(self.save_state.is_none(), "Finalized DisplayListBuilder with a pending save");
 
         let end_time = precise_time_ns();
 
         (
--- a/gfx/wr/webrender_api/src/font.rs
+++ b/gfx/wr/webrender_api/src/font.rs
@@ -11,20 +11,17 @@ use core_graphics::font::CGFont;
 use serde::de::{self, Deserialize, Deserializer};
 #[cfg(target_os = "macos")]
 use serde::ser::{Serialize, Serializer};
 use std::cmp::Ordering;
 use std::hash::{Hash, Hasher};
 #[cfg(not(target_os = "macos"))]
 use std::path::PathBuf;
 use std::sync::Arc;
-
-use api::IdNamespace;
-use color::ColorU;
-use units::LayoutPoint;
+use {ColorU, IdNamespace, LayoutPoint};
 
 
 #[cfg(not(target_os = "macos"))]
 #[derive(Clone, Debug, Serialize, Deserialize)]
 pub struct NativeFontHandle {
     pub path: PathBuf,
     pub index: u32,
 }
--- a/gfx/wr/webrender_api/src/gradient_builder.rs
+++ b/gfx/wr/webrender_api/src/gradient_builder.rs
@@ -1,117 +1,116 @@
 /* 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/. */
 
-use display_item as di;
-use units::*;
+use {ExtendMode, Gradient, GradientStop, LayoutPoint, LayoutSize, RadialGradient};
 
 
 /// Construct a gradient to be used in display lists.
 ///
 /// Each gradient needs at least two stops.
 pub struct GradientBuilder {
-    stops: Vec<di::GradientStop>,
+    stops: Vec<GradientStop>,
 }
 
 impl GradientBuilder {
     /// Create a new gradient builder.
-    pub fn new() -> Self {
+    pub fn new() -> GradientBuilder {
         GradientBuilder {
             stops: Vec::new(),
         }
     }
 
     /// Create a gradient builder with a list of stops.
-    pub fn with_stops(stops: Vec<di::GradientStop>) -> GradientBuilder {
+    pub fn with_stops(stops: Vec<GradientStop>) -> GradientBuilder {
         GradientBuilder { stops }
     }
 
     /// Push an additional stop for the gradient.
-    pub fn push(&mut self, stop: di::GradientStop) {
+    pub fn push(&mut self, stop: GradientStop) {
         self.stops.push(stop);
     }
 
     /// Get a reference to the list of stops.
-    pub fn stops(&self) -> &[di::GradientStop] {
+    pub fn stops(&self) -> &[GradientStop] {
         self.stops.as_ref()
     }
 
     /// Return the gradient stops vector.
-    pub fn into_stops(self) -> Vec<di::GradientStop> {
+    pub fn into_stops(self) -> Vec<GradientStop> {
         self.stops
     }
 
     /// Produce a linear gradient, normalize the stops.
     pub fn gradient(
         &mut self,
         start_point: LayoutPoint,
         end_point: LayoutPoint,
-        extend_mode: di::ExtendMode,
-    ) -> di::Gradient {
+        extend_mode: ExtendMode,
+    ) -> Gradient {
         let (start_offset, end_offset) = self.normalize(extend_mode);
         let start_to_end = end_point - start_point;
 
-        di::Gradient {
+        Gradient {
             start_point: start_point + start_to_end * start_offset,
             end_point: start_point + start_to_end * end_offset,
             extend_mode,
         }
     }
 
     /// Produce a radial gradient, normalize the stops.
     ///
     /// Will replace the gradient with a single color
     /// if the radius negative.
     pub fn radial_gradient(
         &mut self,
         center: LayoutPoint,
         radius: LayoutSize,
-        extend_mode: di::ExtendMode,
-    ) -> di::RadialGradient {
+        extend_mode: ExtendMode,
+    ) -> RadialGradient {
         if radius.width <= 0.0 || radius.height <= 0.0 {
             // The shader cannot handle a non positive radius. So
             // reuse the stops vector and construct an equivalent
             // gradient.
             let last_color = self.stops.last().unwrap().color;
 
             self.stops.clear();
-            self.stops.push(di::GradientStop { offset: 0.0, color: last_color, });
-            self.stops.push(di::GradientStop { offset: 1.0, color: last_color, });
+            self.stops.push(GradientStop { offset: 0.0, color: last_color, });
+            self.stops.push(GradientStop { offset: 1.0, color: last_color, });
 
-            return di::RadialGradient {
+            return RadialGradient {
                 center,
                 radius: LayoutSize::new(1.0, 1.0),
                 start_offset: 0.0,
                 end_offset: 1.0,
                 extend_mode,
             };
         }
 
         let (start_offset, end_offset) =
             self.normalize(extend_mode);
 
-        di::RadialGradient {
+        RadialGradient {
             center,
             radius,
             start_offset,
             end_offset,
             extend_mode,
         }
     }
 
     /// Gradients can be defined with stops outside the range of [0, 1]
     /// when this happens the gradient needs to be normalized by adjusting
     /// the gradient stops and gradient line into an equivalent gradient
     /// with stops in the range [0, 1]. this is done by moving the beginning
     /// of the gradient line to where stop[0] and the end of the gradient line
     /// to stop[n-1]. this function adjusts the stops in place, and returns
     /// the amount to adjust the gradient line start and stop.
-    fn normalize(&mut self, extend_mode: di::ExtendMode) -> (f32, f32) {
+    fn normalize(&mut self, extend_mode: ExtendMode) -> (f32, f32) {
         let stops = &mut self.stops;
         assert!(stops.len() >= 2);
 
         let first = *stops.first().unwrap();
         let last = *stops.last().unwrap();
 
         assert!(first.offset <= last.offset);
 
@@ -125,35 +124,35 @@ impl GradientBuilder {
             (first.offset, last.offset)
         } else {
             // We have a degenerate gradient and can't accurately transform the stops
             // what happens here depends on the repeat behavior, but in any case
             // we reconstruct the gradient stops to something simpler and equivalent
             stops.clear();
 
             match extend_mode {
-                di::ExtendMode::Clamp => {
+                ExtendMode::Clamp => {
                     // This gradient is two colors split at the offset of the stops,
                     // so create a gradient with two colors split at 0.5 and adjust
                     // the gradient line so 0.5 is at the offset of the stops
-                    stops.push(di::GradientStop { color: first.color, offset: 0.0, });
-                    stops.push(di::GradientStop { color: first.color, offset: 0.5, });
-                    stops.push(di::GradientStop { color: last.color, offset: 0.5, });
-                    stops.push(di::GradientStop { color: last.color, offset: 1.0, });
+                    stops.push(GradientStop { color: first.color, offset: 0.0, });
+                    stops.push(GradientStop { color: first.color, offset: 0.5, });
+                    stops.push(GradientStop { color: last.color, offset: 0.5, });
+                    stops.push(GradientStop { color: last.color, offset: 1.0, });
 
                     let offset = last.offset;
 
                     (offset - 0.5, offset + 0.5)
                 }
-                di::ExtendMode::Repeat => {
+                ExtendMode::Repeat => {
                     // A repeating gradient with stops that are all in the same
                     // position should just display the last color. I believe the
                     // spec says that it should be the average color of the gradient,
                     // but this matches what Gecko and Blink does
-                    stops.push(di::GradientStop { color: last.color, offset: 0.0, });
-                    stops.push(di::GradientStop { color: last.color, offset: 1.0, });
+                    stops.push(GradientStop { color: last.color, offset: 0.0, });
+                    stops.push(GradientStop { color: last.color, offset: 1.0, });
 
                     (0.0, 1.0)
                 }
             }
         }
     }
 }
--- a/gfx/wr/webrender_api/src/image.rs
+++ b/gfx/wr/webrender_api/src/image.rs
@@ -1,21 +1,22 @@
 /* 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/. */
 
 #![deny(missing_docs)]
 
+extern crate serde_bytes;
+
+use font::{FontInstanceKey, FontInstanceData, FontKey, FontTemplate};
+use std::sync::Arc;
+use {DeviceIntPoint, DeviceIntRect, DeviceIntSize, LayoutIntRect};
+use {BlobDirtyRect, IdNamespace, TileOffset, TileSize};
 use euclid::{size2, TypedRect, num::Zero};
 use std::ops::{Add, Sub};
-use std::sync::Arc;
-
-use api::{IdNamespace, TileSize};
-use font::{FontInstanceKey, FontInstanceData, FontKey, FontTemplate};
-use units::*;
 
 /// An opaque identifier describing an image registered with WebRender.
 /// This is used as a handle to reference images, and is used as the
 /// hash map key for the actual image storage in the `ResourceCache`.
 #[repr(C)]
 #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, MallocSizeOf, PartialEq, Serialize)]
 pub struct ImageKey(pub IdNamespace, pub u32);
 
--- a/gfx/wr/webrender_api/src/units.rs
+++ b/gfx/wr/webrender_api/src/units.rs
@@ -11,18 +11,17 @@
 //!
 //! The terms "layer" and "stacking context" can be used interchangeably
 //! in the context of coordinate systems.
 
 use app_units::Au;
 use euclid::{Length, TypedRect, TypedScale, TypedSize2D, TypedTransform3D, TypedTranslation2D};
 use euclid::{TypedPoint2D, TypedPoint3D, TypedVector2D, TypedVector3D, TypedSideOffsets2D};
 use euclid::HomogeneousVector;
-
-use image::DirtyRect;
+use DirtyRect;
 
 /// Geometry in the coordinate system of the render target (screen or intermediate
 /// surface) in physical pixels.
 #[derive(Hash, Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Serialize, Deserialize)]
 pub struct DevicePixel;
 
 pub type DeviceIntRect = TypedRect<i32, DevicePixel>;
 pub type DeviceIntPoint = TypedPoint2D<i32, DevicePixel>;