mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
auto merge of #3832 : pcwalton/servo/display-list-inline, r=mrobinson
r? @mrobinson (or whoever)
This commit is contained in:
commit
3aad350a64
2 changed files with 7 additions and 0 deletions
|
@ -7,6 +7,7 @@ use azure::azure_hl::Color as AzColor;
|
||||||
|
|
||||||
pub type Color = AzColor;
|
pub type Color = AzColor;
|
||||||
|
|
||||||
|
#[inline]
|
||||||
pub fn rgb(r: u8, g: u8, b: u8) -> AzColor {
|
pub fn rgb(r: u8, g: u8, b: u8) -> AzColor {
|
||||||
AzColor {
|
AzColor {
|
||||||
r: (r as AzFloat) / (255.0 as AzFloat),
|
r: (r as AzFloat) / (255.0 as AzFloat),
|
||||||
|
@ -16,6 +17,7 @@ pub fn rgb(r: u8, g: u8, b: u8) -> AzColor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
pub fn rgba(r: AzFloat, g: AzFloat, b: AzFloat, a: AzFloat) -> AzColor {
|
pub fn rgba(r: AzFloat, g: AzFloat, b: AzFloat, a: AzFloat) -> AzColor {
|
||||||
AzColor { r: r, g: g, b: b, a: a }
|
AzColor { r: r, g: g, b: b, a: a }
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,6 +159,7 @@ pub enum StackingLevel {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl StackingLevel {
|
impl StackingLevel {
|
||||||
|
#[inline]
|
||||||
pub fn from_background_and_border_level(level: BackgroundAndBorderLevel) -> StackingLevel {
|
pub fn from_background_and_border_level(level: BackgroundAndBorderLevel) -> StackingLevel {
|
||||||
match level {
|
match level {
|
||||||
RootOfStackingContextLevel => BackgroundAndBordersStackingLevel,
|
RootOfStackingContextLevel => BackgroundAndBordersStackingLevel,
|
||||||
|
@ -258,6 +259,7 @@ impl<'a> Iterator<&'a DisplayList> for DisplayListIterator<'a> {
|
||||||
|
|
||||||
impl DisplayList {
|
impl DisplayList {
|
||||||
/// Creates a new display list.
|
/// Creates a new display list.
|
||||||
|
#[inline]
|
||||||
pub fn new() -> DisplayList {
|
pub fn new() -> DisplayList {
|
||||||
DisplayList {
|
DisplayList {
|
||||||
list: DList::new(),
|
list: DList::new(),
|
||||||
|
@ -265,6 +267,7 @@ impl DisplayList {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Appends the given item to the display list.
|
/// Appends the given item to the display list.
|
||||||
|
#[inline]
|
||||||
pub fn push(&mut self, item: DisplayItem) {
|
pub fn push(&mut self, item: DisplayItem) {
|
||||||
self.list.push(item)
|
self.list.push(item)
|
||||||
}
|
}
|
||||||
|
@ -297,6 +300,7 @@ impl DisplayList {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns a preorder iterator over the given display list.
|
/// Returns a preorder iterator over the given display list.
|
||||||
|
#[inline]
|
||||||
pub fn iter<'a>(&'a self) -> DisplayItemIterator<'a> {
|
pub fn iter<'a>(&'a self) -> DisplayItemIterator<'a> {
|
||||||
ParentDisplayItemIterator(self.list.iter())
|
ParentDisplayItemIterator(self.list.iter())
|
||||||
}
|
}
|
||||||
|
@ -401,6 +405,7 @@ pub struct BaseDisplayItem {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl BaseDisplayItem {
|
impl BaseDisplayItem {
|
||||||
|
#[inline(always)]
|
||||||
pub fn new(bounds: Rect<Au>, node: OpaqueNode, level: StackingLevel, clip_rect: Rect<Au>)
|
pub fn new(bounds: Rect<Au>, node: OpaqueNode, level: StackingLevel, clip_rect: Rect<Au>)
|
||||||
-> BaseDisplayItem {
|
-> BaseDisplayItem {
|
||||||
BaseDisplayItem {
|
BaseDisplayItem {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue