servo: Merge #14060 - Remove the direct azure dependencies from gfx, layout and layout_thread (from servo:gfx-azure); r=nox
authorMs2ger <Ms2ger@gmail.com>
Sat, 05 Nov 2016 07:26:30 -0500
changeset 340069 295d2465b0c3696e52058e742a9dad18b9b8e6db
parent 340068 a0c95e6533472dd76d72bbad840798d13daddd08
child 340070 0b8530a54cdcb45dcf559764c1307b49c60aebd5
push id31307
push usergszorc@mozilla.com
push dateSat, 04 Feb 2017 00:59:06 +0000
treeherdermozilla-central@94079d43835f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnox
servo: Merge #14060 - Remove the direct azure dependencies from gfx, layout and layout_thread (from servo:gfx-azure); r=nox Source-Repo: https://github.com/servo/servo Source-Revision: f7875dad1a43792ff3869f292990d03d30ebd9eb
servo/components/gfx/Cargo.toml
servo/components/gfx/display_list/mod.rs
servo/components/gfx/lib.rs
servo/components/layout/Cargo.toml
servo/components/layout/display_list_builder.rs
servo/components/layout/lib.rs
servo/components/layout/webrender_helpers.rs
servo/components/layout_thread/Cargo.toml
servo/components/layout_thread/lib.rs
servo/components/servo/Cargo.lock
servo/ports/cef/Cargo.lock
--- a/servo/components/gfx/Cargo.toml
+++ b/servo/components/gfx/Cargo.toml
@@ -7,17 +7,16 @@ license = "MPL-2.0"
 publish = false
 
 [lib]
 name = "gfx"
 path = "lib.rs"
 
 [dependencies]
 app_units = "0.3"
-azure = {git = "https://github.com/servo/rust-azure", features = ["plugins"]}
 bitflags = "0.7"
 euclid = "0.10.1"
 fnv = "1.0"
 fontsan = {git = "https://github.com/servo/fontsan"}
 gfx_traits = {path = "../gfx_traits"}
 harfbuzz-sys = "0.1"
 heapsize = "0.3.0"
 heapsize_derive = "0.1"
--- a/servo/components/gfx/display_list/mod.rs
+++ b/servo/components/gfx/display_list/mod.rs
@@ -10,17 +10,16 @@
 //! (although this benefit does not apply to GPU-based painting).
 //!
 //! Display items describe relatively high-level drawing operations (for example, entire borders
 //! and shadows instead of lines and blur operations), to reduce the amount of allocation required.
 //! They are therefore not exactly analogous to constructs like Skia pictures, which consist of
 //! low-level drawing primitives.
 
 use app_units::Au;
-use azure::azure_hl::Color;
 use euclid::{Matrix4D, Point2D, Rect, Size2D};
 use euclid::num::{One, Zero};
 use euclid::rect::TypedRect;
 use euclid::side_offsets::SideOffsets2D;
 use gfx_traits::{ScrollPolicy, ScrollRootId, StackingContextId};
 use gfx_traits::print_tree::PrintTree;
 use ipc_channel::ipc::IpcSharedMemory;
 use msg::constellation_msg::PipelineId;
@@ -30,24 +29,20 @@ use std::cmp::{self, Ordering};
 use std::collections::HashMap;
 use std::fmt;
 use std::sync::Arc;
 use style::computed_values::{border_style, filter, image_rendering, mix_blend_mode};
 use style_traits::cursor::Cursor;
 use text::TextRun;
 use text::glyph::ByteIndex;
 use util::geometry::{self, max_rect};
-use webrender_traits::{self, WebGLContextId};
+use webrender_traits::{self, ColorF, GradientStop, WebGLContextId};
 
 pub use style::dom::OpaqueNode;
 
-// It seems cleaner to have layout code not mention Azure directly, so let's just reexport this for
-// layout to use.
-pub use azure::azure_hl::GradientStop;
-
 /// The factor that we multiply the blur radius by in order to inflate the boundaries of display
 /// items that involve a blur. This ensures that the display item boundaries include all the ink.
 pub static BLUR_INFLATION_FACTOR: i32 = 3;
 
 #[derive(HeapSizeOf, Deserialize, Serialize)]
 pub struct DisplayList {
     pub list: Vec<DisplayItem>,
 }
@@ -745,34 +740,34 @@ pub struct DisplayItemMetadata {
 
 /// Paints a solid color.
 #[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
 pub struct SolidColorDisplayItem {
     /// Fields common to all display items.
     pub base: BaseDisplayItem,
 
     /// The color.
-    pub color: Color,
+    pub color: ColorF,
 }
 
 /// Paints text.
 #[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
 pub struct TextDisplayItem {
     /// Fields common to all display items.
     pub base: BaseDisplayItem,
 
     /// The text run.
     #[ignore_heap_size_of = "Because it is non-owning"]
     pub text_run: Arc<TextRun>,
 
     /// The range of text within the text run.
     pub range: Range<ByteIndex>,
 
     /// The color of the text.
-    pub text_color: Color,
+    pub text_color: ColorF,
 
     /// The position of the start of the baseline of this text.
     pub baseline_origin: Point2D<Au>,
 
     /// The orientation of the text: upright or sideways left/right.
     pub orientation: TextOrientation,
 
     /// The blur radius for this text. If zero, this text is not blurred.
@@ -846,17 +841,17 @@ pub struct GradientDisplayItem {
 pub struct BorderDisplayItem {
     /// Fields common to all display items.
     pub base: BaseDisplayItem,
 
     /// Border widths.
     pub border_widths: SideOffsets2D<Au>,
 
     /// Border colors.
-    pub color: SideOffsets2D<Color>,
+    pub color: SideOffsets2D<ColorF>,
 
     /// Border styles.
     pub style: SideOffsets2D<border_style::T>,
 
     /// Border radii.
     ///
     /// TODO(pcwalton): Elliptical radii.
     pub radius: BorderRadii<Au>,
@@ -927,17 +922,17 @@ impl<T> BorderRadii<T> where T: PartialE
 }
 
 /// Paints a line segment.
 #[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
 pub struct LineDisplayItem {
     pub base: BaseDisplayItem,
 
     /// The line segment color.
-    pub color: Color,
+    pub color: ColorF,
 
     /// The line segment style.
     pub style: border_style::T
 }
 
 /// Paints a box shadow per CSS-BACKGROUNDS.
 #[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
 pub struct BoxShadowDisplayItem {
@@ -946,17 +941,17 @@ pub struct BoxShadowDisplayItem {
 
     /// The dimensions of the box that we're placing a shadow around.
     pub box_bounds: Rect<Au>,
 
     /// The offset of this shadow from the box.
     pub offset: Point2D<Au>,
 
     /// The color of this shadow.
-    pub color: Color,
+    pub color: ColorF,
 
     /// The blur radius for this shadow.
     pub blur_radius: Au,
 
     /// The spread radius of this shadow.
     pub spread_radius: Au,
 
     /// The border radius of this shadow.
--- a/servo/components/gfx/lib.rs
+++ b/servo/components/gfx/lib.rs
@@ -13,17 +13,16 @@
 #![feature(unique)]
 
 #![plugin(plugins)]
 
 #![deny(unsafe_code)]
 
 extern crate alloc;
 extern crate app_units;
-extern crate azure;
 #[allow(unused_extern_crates)]
 #[macro_use]
 extern crate bitflags;
 
 // Mac OS-specific library dependencies
 #[cfg(target_os = "macos")] extern crate byteorder;
 #[cfg(target_os = "macos")] extern crate core_foundation;
 #[cfg(target_os = "macos")] extern crate core_graphics;
--- a/servo/components/layout/Cargo.toml
+++ b/servo/components/layout/Cargo.toml
@@ -6,17 +6,16 @@ license = "MPL-2.0"
 publish = false
 
 [lib]
 name = "layout"
 path = "lib.rs"
 
 [dependencies]
 app_units = "0.3"
-azure = {git = "https://github.com/servo/rust-azure", features = ["plugins"]}
 bitflags = "0.7"
 canvas_traits = {path = "../canvas_traits"}
 cssparser = {version = "0.7", features = ["heap_size", "serde-serialization"]}
 euclid = "0.10.1"
 fnv = "1.0"
 gfx = {path = "../gfx"}
 gfx_traits = {path = "../gfx_traits"}
 heapsize = "0.3.0"
--- a/servo/components/layout/display_list_builder.rs
+++ b/servo/components/layout/display_list_builder.rs
@@ -6,30 +6,29 @@
 //!
 //! Other browser engines sometimes call this "painting", but it is more accurately called display
 //! list building, as the actual painting does not happen here—only deciding *what* we're going to
 //! paint.
 
 #![deny(unsafe_code)]
 
 use app_units::{AU_PER_PX, Au};
-use azure::azure_hl::Color;
 use block::{BlockFlow, BlockStackingContextType};
 use canvas_traits::{CanvasData, CanvasMsg, FromLayoutMsg};
 use context::SharedLayoutContext;
 use euclid::{Matrix4D, Point2D, Radians, Rect, SideOffsets2D, Size2D};
 use flex::FlexFlow;
 use flow::{BaseFlow, Flow, IS_ABSOLUTELY_POSITIONED};
 use flow_ref::FlowRef;
 use fragment::{CoordinateSystem, Fragment, ImageFragmentInfo, ScannedTextFragmentInfo};
 use fragment::SpecificFragmentInfo;
 use gfx::display_list::{BLUR_INFLATION_FACTOR, BaseDisplayItem, BorderDisplayItem};
 use gfx::display_list::{BorderRadii, BoxShadowClipMode, BoxShadowDisplayItem, ClippingRegion};
 use gfx::display_list::{DisplayItem, DisplayItemMetadata, DisplayList, DisplayListSection};
-use gfx::display_list::{GradientDisplayItem, GradientStop, IframeDisplayItem, ImageDisplayItem};
+use gfx::display_list::{GradientDisplayItem, IframeDisplayItem, ImageDisplayItem};
 use gfx::display_list::{LineDisplayItem, OpaqueNode};
 use gfx::display_list::{SolidColorDisplayItem, StackingContext, StackingContextType};
 use gfx::display_list::{TextDisplayItem, TextOrientation, WebGLDisplayItem, WebRenderImageInfo};
 use gfx_traits::{ScrollPolicy, ScrollRootId, StackingContextId};
 use inline::{FIRST_FRAGMENT_OF_ELEMENT, InlineFlow, LAST_FRAGMENT_OF_ELEMENT};
 use ipc_channel::ipc;
 use list_item::ListItemFlow;
 use model::{self, MaybeAuto, ToGfxMatrix};
@@ -55,26 +54,42 @@ use style::properties::style_structs;
 use style::values::RGBA;
 use style::values::computed;
 use style::values::computed::{Gradient, GradientKind, LengthOrNone, LengthOrPercentage, LengthOrPercentageOrAuto};
 use style::values::specified::{AngleOrCorner, HorizontalDirection, VerticalDirection};
 use style_traits::cursor::Cursor;
 use table_cell::CollapsedBordersForCell;
 use url::Url;
 use util::opts;
+use webrender_traits::{ColorF, GradientStop};
 
-static THREAD_TINT_COLORS: [Color; 8] = [
-    Color { r: 6.0 / 255.0, g: 153.0 / 255.0, b: 198.0 / 255.0, a: 0.7 },
-    Color { r: 255.0 / 255.0, g: 212.0 / 255.0, b: 83.0 / 255.0, a: 0.7 },
-    Color { r: 116.0 / 255.0, g: 29.0 / 255.0, b: 109.0 / 255.0, a: 0.7 },
-    Color { r: 204.0 / 255.0, g: 158.0 / 255.0, b: 199.0 / 255.0, a: 0.7 },
-    Color { r: 242.0 / 255.0, g: 46.0 / 255.0, b: 121.0 / 255.0, a: 0.7 },
-    Color { r: 116.0 / 255.0, g: 203.0 / 255.0, b: 196.0 / 255.0, a: 0.7 },
-    Color { r: 255.0 / 255.0, g: 249.0 / 255.0, b: 201.0 / 255.0, a: 0.7 },
-    Color { r: 137.0 / 255.0, g: 196.0 / 255.0, b: 78.0 / 255.0, a: 0.7 },
+trait RgbColor {
+    fn rgb(r: u8, g: u8, b: u8) -> Self;
+}
+
+impl RgbColor for ColorF {
+    fn rgb(r: u8, g: u8, b: u8) -> Self {
+        ColorF {
+            r: (r as f32) / (255.0 as f32),
+            g: (g as f32) / (255.0 as f32),
+            b: (b as f32) / (255.0 as f32),
+            a: 1.0 as f32
+        }
+    }
+}
+
+static THREAD_TINT_COLORS: [ColorF; 8] = [
+    ColorF { r: 6.0 / 255.0, g: 153.0 / 255.0, b: 198.0 / 255.0, a: 0.7 },
+    ColorF { r: 255.0 / 255.0, g: 212.0 / 255.0, b: 83.0 / 255.0, a: 0.7 },
+    ColorF { r: 116.0 / 255.0, g: 29.0 / 255.0, b: 109.0 / 255.0, a: 0.7 },
+    ColorF { r: 204.0 / 255.0, g: 158.0 / 255.0, b: 199.0 / 255.0, a: 0.7 },
+    ColorF { r: 242.0 / 255.0, g: 46.0 / 255.0, b: 121.0 / 255.0, a: 0.7 },
+    ColorF { r: 116.0 / 255.0, g: 203.0 / 255.0, b: 196.0 / 255.0, a: 0.7 },
+    ColorF { r: 255.0 / 255.0, g: 249.0 / 255.0, b: 201.0 / 255.0, a: 0.7 },
+    ColorF { r: 137.0 / 255.0, g: 196.0 / 255.0, b: 78.0 / 255.0, a: 0.7 },
 ];
 
 fn get_cyclic<T>(arr: &[T], index: usize) -> &T {
     &arr[index % arr.len()]
 }
 
 pub struct DisplayListBuildState<'a> {
     pub shared_layout_context: &'a SharedLayoutContext,
@@ -1048,17 +1063,17 @@ impl FragmentDisplayListBuilding for Fra
         let base = state.create_base_display_item(stacking_relative_border_box,
                                                   clip,
                                                   self.node,
                                                   style.get_cursor(Cursor::Default),
                                                   DisplayListSection::Content);
         state.add_display_item(DisplayItem::Border(box BorderDisplayItem {
             base: base,
             border_widths: SideOffsets2D::new_all_same(Au::from_px(1)),
-            color: SideOffsets2D::new_all_same(Color::rgb(0, 0, 200)),
+            color: SideOffsets2D::new_all_same(ColorF::rgb(0, 0, 200)),
             style: SideOffsets2D::new_all_same(border_style::T::solid),
             radius: Default::default(),
         }));
 
         // Draw a rectangle representing the baselines.
         let mut baseline = LogicalRect::from_physical(self.style.writing_mode,
                                                       *stacking_relative_content_box,
                                                       container_size);
@@ -1068,17 +1083,17 @@ impl FragmentDisplayListBuilding for Fra
 
         let base = state.create_base_display_item(&baseline,
                                                   clip,
                                                   self.node,
                                                   style.get_cursor(Cursor::Default),
                                                   DisplayListSection::Content);
         state.add_display_item(DisplayItem::Line(box LineDisplayItem {
             base: base,
-            color: Color::rgb(0, 200, 0),
+            color: ColorF::rgb(0, 200, 0),
             style: border_style::T::dashed,
         }));
     }
 
     fn build_debug_borders_around_fragment(&self,
                                            state: &mut DisplayListBuildState,
                                            stacking_relative_border_box: &Rect<Au>,
                                            clip: &ClippingRegion) {
@@ -1086,17 +1101,17 @@ impl FragmentDisplayListBuilding for Fra
         let base = state.create_base_display_item(stacking_relative_border_box,
                                                   clip,
                                                   self.node,
                                                   self.style.get_cursor(Cursor::Default),
                                                   DisplayListSection::Content);
         state.add_display_item(DisplayItem::Border(box BorderDisplayItem {
             base: base,
             border_widths: SideOffsets2D::new_all_same(Au::from_px(1)),
-            color: SideOffsets2D::new_all_same(Color::rgb(0, 0, 200)),
+            color: SideOffsets2D::new_all_same(ColorF::rgb(0, 0, 200)),
             style: SideOffsets2D::new_all_same(border_style::T::solid),
             radius: Default::default(),
         }));
     }
 
     fn adjust_clip_for_style(&self,
                              parent_clip: &mut ClippingRegion,
                              stacking_relative_border_box: &Rect<Au>) {
@@ -2186,22 +2201,22 @@ fn position_to_offset(position: LengthOr
 fn shadow_bounds(content_rect: &Rect<Au>, blur_radius: Au, spread_radius: Au) -> Rect<Au> {
     let inflation = spread_radius + blur_radius * BLUR_INFLATION_FACTOR;
     content_rect.inflate(inflation, inflation)
 }
 
 /// Allows a CSS color to be converted into a graphics color.
 pub trait ToGfxColor {
     /// Converts a CSS color to a graphics color.
-    fn to_gfx_color(&self) -> Color;
+    fn to_gfx_color(&self) -> ColorF;
 }
 
 impl ToGfxColor for RGBA {
-    fn to_gfx_color(&self) -> Color {
-        Color::rgba(self.red, self.green, self.blue, self.alpha)
+    fn to_gfx_color(&self) -> ColorF {
+        ColorF::new(self.red, self.green, self.blue, self.alpha)
     }
 }
 
 /// Describes how to paint the borders.
 #[derive(Copy, Clone)]
 pub enum BorderPaintingMode<'a> {
     /// Paint borders separately (`border-collapse: separate`).
     Separate,
--- a/servo/components/layout/lib.rs
+++ b/servo/components/layout/lib.rs
@@ -11,17 +11,16 @@
 #![feature(raw)]
 #![feature(step_by)]
 
 #![deny(unsafe_code)]
 
 #![plugin(plugins)]
 
 extern crate app_units;
-extern crate azure;
 #[allow(unused_extern_crates)]
 #[macro_use]
 extern crate bitflags;
 extern crate canvas_traits;
 extern crate core;
 extern crate cssparser;
 extern crate euclid;
 extern crate fnv;
--- a/servo/components/layout/webrender_helpers.rs
+++ b/servo/components/layout/webrender_helpers.rs
@@ -3,21 +3,20 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // TODO(gw): This contains helper traits and implementations for converting Servo display lists
 //           into WebRender display lists. In the future, this step should be completely removed.
 //           This might be achieved by sharing types between WR and Servo display lists, or
 //           completely converting layout to directly generate WebRender display lists, for example.
 
 use app_units::Au;
-use azure::azure_hl::Color;
 use euclid::{Point2D, Rect, Size2D};
 use gfx::display_list::{BorderRadii, BoxShadowClipMode, ClippingRegion};
 use gfx::display_list::{DisplayItem, DisplayList, DisplayListTraversal};
-use gfx::display_list::{GradientStop, StackingContext, StackingContextType};
+use gfx::display_list::{StackingContext, StackingContextType};
 use gfx_traits::{FragmentType, ScrollPolicy, StackingContextId, ScrollRootId};
 use style::computed_values::{image_rendering, mix_blend_mode};
 use style::computed_values::filter::{self, Filter};
 use style::values::computed::BorderStyle;
 use webrender_traits::{self, AuxiliaryListsBuilder, DisplayListId, PipelineId};
 
 trait WebRenderStackingContextConverter {
     fn convert_to_webrender<'a>(&self,
@@ -117,39 +116,16 @@ impl ToRectF for Rect<Au> {
         let x = self.origin.x.to_f32_px();
         let y = self.origin.y.to_f32_px();
         let w = self.size.width.to_f32_px();
         let h = self.size.height.to_f32_px();
         Rect::new(Point2D::new(x, y), Size2D::new(w, h))
     }
 }
 
-trait ToColorF {
-    fn to_colorf(&self) -> webrender_traits::ColorF;
-}
-
-impl ToColorF for Color {
-    fn to_colorf(&self) -> webrender_traits::ColorF {
-        webrender_traits::ColorF::new(self.r, self.g, self.b, self.a)
-    }
-}
-
-trait ToGradientStop {
-    fn to_gradient_stop(&self) -> webrender_traits::GradientStop;
-}
-
-impl ToGradientStop for GradientStop {
-    fn to_gradient_stop(&self) -> webrender_traits::GradientStop {
-        webrender_traits::GradientStop {
-            offset: self.offset,
-            color: self.color.to_colorf(),
-        }
-    }
-}
-
 trait ToClipRegion {
     fn to_clip_region(&self, frame_builder: &mut WebRenderFrameBuilder)
                       -> webrender_traits::ClipRegion;
 }
 
 impl ToClipRegion for ClippingRegion {
     fn to_clip_region(&self, frame_builder: &mut WebRenderFrameBuilder)
                       -> webrender_traits::ClipRegion {
@@ -347,17 +323,17 @@ impl WebRenderDisplayListConverter for D
 }
 
 impl WebRenderDisplayItemConverter for DisplayItem {
     fn convert_to_webrender(&self,
                             builder: &mut webrender_traits::DisplayListBuilder,
                             frame_builder: &mut WebRenderFrameBuilder) {
         match *self {
             DisplayItem::SolidColor(ref item) => {
-                let color = item.color.to_colorf();
+                let color = item.color;
                 if color.a > 0.0 {
                     builder.push_rect(item.base.bounds.to_rectf(),
                                       item.base.clip.to_clip_region(frame_builder),
                                       color);
                 }
             }
             DisplayItem::Text(ref item) => {
                 let mut origin = item.baseline_origin.clone();
@@ -383,17 +359,17 @@ impl WebRenderDisplayItemConverter for D
                     };
                 }
 
                 if glyphs.len() > 0 {
                     builder.push_text(item.base.bounds.to_rectf(),
                                       item.base.clip.to_clip_region(frame_builder),
                                       glyphs,
                                       item.text_run.font_key,
-                                      item.text_color.to_colorf(),
+                                      item.text_color,
                                       item.text_run.actual_pt_size,
                                       item.blur_radius,
                                       &mut frame_builder.auxiliary_lists_builder);
                 }
             }
             DisplayItem::Image(ref item) => {
                 if let Some(id) = item.webrender_image.key {
                     if item.stretch_size.width > Au(0) &&
@@ -411,69 +387,65 @@ impl WebRenderDisplayItemConverter for D
                 builder.push_webgl_canvas(item.base.bounds.to_rectf(),
                                           item.base.clip.to_clip_region(frame_builder),
                                           item.context_id);
             }
             DisplayItem::Border(ref item) => {
                 let rect = item.base.bounds.to_rectf();
                 let left = webrender_traits::BorderSide {
                     width: item.border_widths.left.to_f32_px(),
-                    color: item.color.left.to_colorf(),
+                    color: item.color.left,
                     style: item.style.left.to_border_style(),
                 };
                 let top = webrender_traits::BorderSide {
                     width: item.border_widths.top.to_f32_px(),
-                    color: item.color.top.to_colorf(),
+                    color: item.color.top,
                     style: item.style.top.to_border_style(),
                 };
                 let right = webrender_traits::BorderSide {
                     width: item.border_widths.right.to_f32_px(),
-                    color: item.color.right.to_colorf(),
+                    color: item.color.right,
                     style: item.style.right.to_border_style(),
                 };
                 let bottom = webrender_traits::BorderSide {
                     width: item.border_widths.bottom.to_f32_px(),
-                    color: item.color.bottom.to_colorf(),
+                    color: item.color.bottom,
                     style: item.style.bottom.to_border_style(),
                 };
                 let radius = item.radius.to_border_radius();
                 builder.push_border(rect,
                                     item.base.clip.to_clip_region(frame_builder),
                                     left,
                                     top,
                                     right,
                                     bottom,
                                     radius);
             }
             DisplayItem::Gradient(ref item) => {
                 let rect = item.base.bounds.to_rectf();
                 let start_point = item.start_point.to_pointf();
                 let end_point = item.end_point.to_pointf();
-                let mut stops = Vec::new();
-                for stop in &item.stops {
-                    stops.push(stop.to_gradient_stop());
-                }
                 builder.push_gradient(rect,
                                       item.base.clip.to_clip_region(frame_builder),
                                       start_point,
                                       end_point,
-                                      stops,
+                                      item.stops.clone(),
                                       &mut frame_builder.auxiliary_lists_builder);
             }
             DisplayItem::Line(..) => {
                 println!("TODO DisplayItem::Line");
             }
             DisplayItem::BoxShadow(ref item) => {
                 let rect = item.base.bounds.to_rectf();
                 let box_bounds = item.box_bounds.to_rectf();
                 builder.push_box_shadow(rect,
                                         item.base.clip.to_clip_region(frame_builder),
                                         box_bounds,
                                         item.offset.to_pointf(),
-                                        item.color.to_colorf(),
+                                        item.color,
                                         item.blur_radius.to_f32_px(),
                                         item.spread_radius.to_f32_px(),
                                         item.border_radius.to_f32_px(),
                                         item.clip_mode.to_clip_mode());
             }
             DisplayItem::Iframe(ref item) => {
                 let rect = item.base.bounds.to_rectf();
                 let pipeline_id = item.iframe.to_webrender();
--- a/servo/components/layout_thread/Cargo.toml
+++ b/servo/components/layout_thread/Cargo.toml
@@ -6,17 +6,16 @@ license = "MPL-2.0"
 publish = false
 
 [lib]
 name = "layout_thread"
 path = "lib.rs"
 
 [dependencies]
 app_units = "0.3"
-azure = {git = "https://github.com/servo/rust-azure", features = ["plugins"]}
 euclid = "0.10.1"
 fnv = "1.0"
 gfx = {path = "../gfx"}
 gfx_traits = {path = "../gfx_traits"}
 heapsize = "0.3.0"
 heapsize_derive = "0.1"
 ipc-channel = "0.5"
 layout = {path = "../layout"}
--- a/servo/components/layout_thread/lib.rs
+++ b/servo/components/layout_thread/lib.rs
@@ -8,17 +8,16 @@
 #![feature(box_syntax)]
 #![feature(mpsc_select)]
 #![feature(plugin)]
 #![feature(proc_macro)]
 
 #![plugin(plugins)]
 
 extern crate app_units;
-extern crate azure;
 extern crate core;
 extern crate euclid;
 extern crate fnv;
 extern crate gfx;
 extern crate gfx_traits;
 extern crate heapsize;
 #[macro_use] extern crate heapsize_derive;
 extern crate ipc_channel;
@@ -41,17 +40,16 @@ extern crate script_traits;
 extern crate selectors;
 extern crate serde_json;
 extern crate style;
 extern crate url;
 extern crate util;
 extern crate webrender_traits;
 
 use app_units::Au;
-use azure::azure_hl::Color;
 use euclid::point::Point2D;
 use euclid::rect::Rect;
 use euclid::scale_factor::ScaleFactor;
 use euclid::size::Size2D;
 use fnv::FnvHasher;
 use gfx::display_list::{ClippingRegion, OpaqueNode, WebRenderImageInfo};
 use gfx::font;
 use gfx::font_cache_thread::FontCacheThread;
@@ -964,21 +962,16 @@ impl LayoutThread {
             // TODO(gw) For now only create a root scrolling layer!
             let mut frame_builder = WebRenderFrameBuilder::new(pipeline_id);
             let sc_id = rw_data.display_list.as_ref().unwrap().convert_to_webrender(
                 &mut self.webrender_api,
                 pipeline_id,
                 epoch,
                 &mut frame_builder);
             let root_background_color = get_root_flow_background_color(layout_root);
-            let root_background_color =
-                webrender_traits::ColorF::new(root_background_color.r,
-                                              root_background_color.g,
-                                              root_background_color.b,
-                                              root_background_color.a);
 
             let viewport_size = Size2D::new(self.viewport_size.width.to_f32_px(),
                                             self.viewport_size.height.to_f32_px());
 
             self.webrender_api.set_root_stacking_context(sc_id,
                                                          root_background_color,
                                                          epoch,
                                                          pipeline_id,
@@ -1486,28 +1479,29 @@ impl LayoutThread {
 // http://dev.w3.org/csswg/css-backgrounds/#background-color). However, we
 // need to propagate the background color from the root HTML/Body
 // element (http://dev.w3.org/csswg/css-backgrounds/#special-backgrounds) if
 // it is non-transparent. The phrase in the spec "If the canvas background
 // is not opaque, what shows through is UA-dependent." is handled by rust-layers
 // clearing the frame buffer to white. This ensures that setting a background
 // color on an iframe element, while the iframe content itself has a default
 // transparent background color is handled correctly.
-fn get_root_flow_background_color(flow: &mut Flow) -> Color {
+fn get_root_flow_background_color(flow: &mut Flow) -> webrender_traits::ColorF {
+    let transparent = webrender_traits::ColorF { r: 0.0, g: 0.0, b: 0.0, a: 0.0 };
     if !flow.is_block_like() {
-        return Color::transparent()
+        return transparent;
     }
 
     let block_flow = flow.as_mut_block();
     let kid = match block_flow.base.children.iter_mut().next() {
-        None => return Color::transparent(),
+        None => return transparent,
         Some(kid) => kid,
     };
     if !kid.is_block_like() {
-        return Color::transparent()
+        return transparent;
     }
 
     let kid_block_flow = kid.as_block();
     kid_block_flow.fragment
                   .style
                   .resolve_color(kid_block_flow.fragment.style.get_background().background_color)
                   .to_gfx_color()
 }
--- a/servo/components/servo/Cargo.lock
+++ b/servo/components/servo/Cargo.lock
@@ -806,17 +806,16 @@ name = "getopts"
 version = "0.2.14"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "gfx"
 version = "0.0.1"
 dependencies = [
  "app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "azure 0.9.1 (git+https://github.com/servo/rust-azure)",
  "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-foundation 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-graphics 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-text 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "euclid 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "fnv 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "fontsan 0.3.2 (git+https://github.com/servo/fontsan)",
@@ -1189,17 +1188,16 @@ name = "language-tags"
 version = "0.2.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "layout"
 version = "0.0.1"
 dependencies = [
  "app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "azure 0.9.1 (git+https://github.com/servo/rust-azure)",
  "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "canvas_traits 0.0.1",
  "cssparser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "euclid 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "fnv 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "gfx 0.0.1",
  "gfx_traits 0.0.1",
  "heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1238,17 +1236,16 @@ dependencies = [
  "layout 0.0.1",
 ]
 
 [[package]]
 name = "layout_thread"
 version = "0.0.1"
 dependencies = [
  "app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "azure 0.9.1 (git+https://github.com/servo/rust-azure)",
  "euclid 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "fnv 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "gfx 0.0.1",
  "gfx_traits 0.0.1",
  "heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
  "heapsize_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "layout 0.0.1",
--- a/servo/ports/cef/Cargo.lock
+++ b/servo/ports/cef/Cargo.lock
@@ -720,17 +720,16 @@ name = "getopts"
 version = "0.2.14"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "gfx"
 version = "0.0.1"
 dependencies = [
  "app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "azure 0.9.1 (git+https://github.com/servo/rust-azure)",
  "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-foundation 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-graphics 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-text 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "euclid 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "fnv 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "fontsan 0.3.2 (git+https://github.com/servo/fontsan)",
@@ -1094,17 +1093,16 @@ name = "language-tags"
 version = "0.2.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "layout"
 version = "0.0.1"
 dependencies = [
  "app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "azure 0.9.1 (git+https://github.com/servo/rust-azure)",
  "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "canvas_traits 0.0.1",
  "cssparser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "euclid 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "fnv 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "gfx 0.0.1",
  "gfx_traits 0.0.1",
  "heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1136,17 +1134,16 @@ dependencies = [
  "webrender_traits 0.8.0 (git+https://github.com/servo/webrender)",
 ]
 
 [[package]]
 name = "layout_thread"
 version = "0.0.1"
 dependencies = [
  "app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "azure 0.9.1 (git+https://github.com/servo/rust-azure)",
  "euclid 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "fnv 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "gfx 0.0.1",
  "gfx_traits 0.0.1",
  "heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
  "heapsize_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "layout 0.0.1",