diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-03-05 11:09:58 -0700 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-03-05 11:09:58 -0700 |
commit | 7fc37dfaa76c9265e6d2145fe5ef2fba5f6bd013 (patch) | |
tree | 48e10efbc7e3389b88d53666bd2e1b92ec198da0 /components/layout/display_list_builder.rs | |
parent | caf5663e0981f36a621dde1dd51be2bd0a15dd24 (diff) | |
parent | 559ff68b31eabdf1025fba2fcc386b504256a0b2 (diff) | |
download | servo-7fc37dfaa76c9265e6d2145fe5ef2fba5f6bd013.tar.gz servo-7fc37dfaa76c9265e6d2145fe5ef2fba5f6bd013.zip |
auto merge of #5135 : iamdanfox/servo/fix-5120-rename-layout-util, r=jdm
A simple rename/refactor (https://github.com/servo/servo/issues/5120)
My first servo contribution!
Diffstat (limited to 'components/layout/display_list_builder.rs')
-rw-r--r-- | components/layout/display_list_builder.rs | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs index e61e8728eb6..c9e82e7eb8e 100644 --- a/components/layout/display_list_builder.rs +++ b/components/layout/display_list_builder.rs @@ -10,6 +10,7 @@ #![deny(unsafe_blocks)] +use azure::azure_hl::Color; use block::BlockFlow; use canvas::canvas_paint_task::CanvasMsg::SendPixelContents; use context::LayoutContext; @@ -19,7 +20,7 @@ use fragment::{ScannedTextFragmentInfo, SpecificFragmentInfo}; use inline::InlineFlow; use list_item::ListItemFlow; use model::{self, MaybeAuto}; -use util::{OpaqueNodeMethods, ToGfxColor}; +use opaque_node::OpaqueNodeMethods; use geom::{Point2D, Rect, Size2D, SideOffsets2D}; use gfx::color; @@ -36,10 +37,10 @@ use msg::compositor_msg::ScrollPolicy; use msg::constellation_msg::Msg as ConstellationMsg; use msg::constellation_msg::ConstellationChan; use net::image::holder::ImageHolder; -use servo_util::cursor::Cursor; -use servo_util::geometry::{self, Au, ZERO_POINT, to_px, to_frac_px}; -use servo_util::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize}; -use servo_util::opts; +use util::cursor::Cursor; +use util::geometry::{self, Au, ZERO_POINT, to_px, to_frac_px}; +use util::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize}; +use util::opts; use std::cmp; use std::default::Default; use std::iter::repeat; @@ -1572,3 +1573,14 @@ fn shadow_bounds(content_rect: &Rect<Au>, blur_radius: Au, spread_radius: Au) -> 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; +} + +impl ToGfxColor for RGBA { + fn to_gfx_color(&self) -> Color { + color::rgba(self.red, self.green, self.blue, self.alpha) + } +} |