mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Companion single Color patch.
This will also update the rust-azure dependency to point to the hash where we have a single Color type. Just executed ref-tests and no regressions found.
This commit is contained in:
parent
52fc01ad37
commit
ffa62c9688
9 changed files with 31 additions and 16 deletions
|
@ -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"
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue