mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Move ToGfxColor to display_list_builder.rs
This commit is contained in:
parent
b424de2092
commit
564d12435a
3 changed files with 14 additions and 17 deletions
|
@ -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,6 @@ use fragment::{ScannedTextFragmentInfo, SpecificFragmentInfo};
|
|||
use inline::InlineFlow;
|
||||
use list_item::ListItemFlow;
|
||||
use model;
|
||||
use util::ToGfxColor;
|
||||
use opaque_node::OpaqueNodeMethods;
|
||||
|
||||
use geom::{Point2D, Rect, Size2D, SideOffsets2D};
|
||||
|
@ -1482,3 +1482,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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue