aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/gfx/color.rs7
-rw-r--r--components/gfx/display_list/mod.rs3
-rw-r--r--components/gfx/paint_context.rs17
-rw-r--r--components/layout/Cargo.toml3
-rw-r--r--components/layout/lib.rs3
-rw-r--r--components/layout/util.rs5
-rw-r--r--components/servo/Cargo.lock3
-rw-r--r--ports/cef/Cargo.lock3
-rw-r--r--ports/gonk/Cargo.lock3
9 files changed, 31 insertions, 16 deletions
diff --git a/components/gfx/color.rs b/components/gfx/color.rs
index 0bf03bff6dc..a91c6818ee6 100644
--- a/components/gfx/color.rs
+++ b/components/gfx/color.rs
@@ -3,9 +3,12 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use azure::AzFloat;
-use azure::azure_hl::Color as AzColor;
+use azure::azure::AzColor;
-pub type Color = AzColor;
+#[inline]
+pub fn new(r: AzFloat, g: AzFloat, b: AzFloat, a: AzFloat) -> AzColor {
+ AzColor { r: r, g: g, b: b, a: a }
+}
#[inline]
pub fn rgb(r: u8, g: u8, b: u8) -> AzColor {
diff --git a/components/gfx/display_list/mod.rs b/components/gfx/display_list/mod.rs
index 99a7cc5fe0c..799810e4a70 100644
--- a/components/gfx/display_list/mod.rs
+++ b/components/gfx/display_list/mod.rs
@@ -16,7 +16,6 @@
#![deny(unsafe_blocks)]
-use color::Color;
use display_list::optimizer::DisplayListOptimizer;
use paint_context::{PaintContext, ToAzureRect};
use self::DisplayItem::*;
@@ -25,6 +24,8 @@ use text::glyph::CharIndex;
use text::TextRun;
use azure::azure::AzFloat;
+use azure::azure_hl::{Color};
+
use collections::dlist::{self, DList};
use geom::{Point2D, Rect, SideOffsets2D, Size2D, Matrix2D};
use geom::num::Zero;
diff --git a/components/gfx/paint_context.rs b/components/gfx/paint_context.rs
index cf564ed1b78..566dd48b030 100644
--- a/components/gfx/paint_context.rs
+++ b/components/gfx/paint_context.rs
@@ -687,7 +687,10 @@ impl<'a> PaintContext<'a> {
}
fn scale_color(&self, color: Color, scale_factor: f32) -> Color {
- return Color::new(color.r * scale_factor, color.g * scale_factor, color.b * scale_factor, color.a);
+ return color::new(color.r * scale_factor,
+ color.g * scale_factor,
+ color.b * scale_factor,
+ color.a);
}
fn draw_double_border_segment(&self,
@@ -735,8 +738,8 @@ impl<'a> PaintContext<'a> {
lighter_color = color;
} else {
// You can't scale black color (i.e. 'scaled = 0 * scale', equals black).
- darker_color = Color::new(0.3, 0.3, 0.3, color.a);
- lighter_color = Color::new(0.7, 0.7, 0.7, color.a);
+ darker_color = color::new(0.3, 0.3, 0.3, color.a);
+ lighter_color = color::new(0.7, 0.7, 0.7, color.a);
}
let (outer_color, inner_color) = match (direction, is_groove) {
@@ -787,16 +790,16 @@ impl<'a> PaintContext<'a> {
scaled_color = match direction {
Direction::Top | Direction::Left => {
if is_inset {
- Color::new(0.3, 0.3, 0.3, color.a)
+ color::new(0.3, 0.3, 0.3, color.a)
} else {
- Color::new(0.7, 0.7, 0.7, color.a)
+ color::new(0.7, 0.7, 0.7, color.a)
}
}
Direction::Right | Direction::Bottom => {
if is_inset {
- Color::new(0.7, 0.7, 0.7, color.a)
+ color::new(0.7, 0.7, 0.7, color.a)
} else {
- Color::new(0.3, 0.3, 0.3, color.a)
+ color::new(0.3, 0.3, 0.3, color.a)
}
}
};
diff --git a/components/layout/Cargo.toml b/components/layout/Cargo.toml
index d20ca50ab09..3445e214a21 100644
--- a/components/layout/Cargo.toml
+++ b/components/layout/Cargo.toml
@@ -7,6 +7,9 @@ authors = ["The Servo Project Developers"]
name = "layout"
path = "lib.rs"
+[dependencies.azure]
+git = "https://github.com/servo/rust-azure"
+
[dependencies.canvas]
path = "../canvas"
diff --git a/components/layout/lib.rs b/components/layout/lib.rs
index a73ea6a7a0f..30057310032 100644
--- a/components/layout/lib.rs
+++ b/components/layout/lib.rs
@@ -25,7 +25,8 @@
#[macro_use]
extern crate log;
-#[macro_use] extern crate bitflags;
+#[macro_use]extern crate bitflags;
+extern crate azure;
extern crate cssparser;
extern crate canvas;
extern crate geom;
diff --git a/components/layout/util.rs b/components/layout/util.rs
index a5e8328118f..481adb895c7 100644
--- a/components/layout/util.rs
+++ b/components/layout/util.rs
@@ -9,6 +9,7 @@ use incremental::RestyleDamage;
use parallel::DomParallelInfo;
use wrapper::{LayoutNode, TLayoutNode, ThreadSafeLayoutNode};
+use azure::azure_hl::{Color};
use gfx::display_list::OpaqueNode;
use gfx;
use libc::{c_void, uintptr_t};
@@ -169,11 +170,11 @@ impl OpaqueNodeMethods for OpaqueNode {
/// 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) -> gfx::color::Color;
+ fn to_gfx_color(&self) -> Color;
}
impl ToGfxColor for style::values::RGBA {
- fn to_gfx_color(&self) -> gfx::color::Color {
+ fn to_gfx_color(&self) -> Color {
gfx::color::rgba(self.red, self.green, self.blue, self.alpha)
}
}
diff --git a/components/servo/Cargo.lock b/components/servo/Cargo.lock
index 794d9e9be40..06dddf9a0c9 100644
--- a/components/servo/Cargo.lock
+++ b/components/servo/Cargo.lock
@@ -36,7 +36,7 @@ dependencies = [
[[package]]
name = "azure"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-azure#9ae7938c56e8c59d09a3ce682dd4cf5fcbb2ac57"
+source = "git+https://github.com/servo/rust-azure#08d2513e8ebbfe9ce6620aa514c2f2b91059b304"
dependencies = [
"core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)",
"core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)",
@@ -476,6 +476,7 @@ dependencies = [
name = "layout"
version = "0.0.1"
dependencies = [
+ "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas 0.0.1",
"cssparser 0.2.0 (git+https://github.com/servo/rust-cssparser)",
diff --git a/ports/cef/Cargo.lock b/ports/cef/Cargo.lock
index 5d9922dbd5c..690e6ea86d5 100644
--- a/ports/cef/Cargo.lock
+++ b/ports/cef/Cargo.lock
@@ -38,7 +38,7 @@ dependencies = [
[[package]]
name = "azure"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-azure#9ae7938c56e8c59d09a3ce682dd4cf5fcbb2ac57"
+source = "git+https://github.com/servo/rust-azure#08d2513e8ebbfe9ce6620aa514c2f2b91059b304"
dependencies = [
"core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)",
"core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)",
@@ -478,6 +478,7 @@ dependencies = [
name = "layout"
version = "0.0.1"
dependencies = [
+ "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas 0.0.1",
"cssparser 0.2.0 (git+https://github.com/servo/rust-cssparser)",
diff --git a/ports/gonk/Cargo.lock b/ports/gonk/Cargo.lock
index 75c20199b54..f4e9dfda1ee 100644
--- a/ports/gonk/Cargo.lock
+++ b/ports/gonk/Cargo.lock
@@ -17,7 +17,7 @@ dependencies = [
[[package]]
name = "azure"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-azure#9ae7938c56e8c59d09a3ce682dd4cf5fcbb2ac57"
+source = "git+https://github.com/servo/rust-azure#08d2513e8ebbfe9ce6620aa514c2f2b91059b304"
dependencies = [
"core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)",
"core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)",
@@ -396,6 +396,7 @@ dependencies = [
name = "layout"
version = "0.0.1"
dependencies = [
+ "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas 0.0.1",
"cssparser 0.2.0 (git+https://github.com/servo/rust-cssparser)",