aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/gfx/color.rs2
-rw-r--r--components/gfx/display_list/mod.rs5
2 files changed, 7 insertions, 0 deletions
diff --git a/components/gfx/color.rs b/components/gfx/color.rs
index 83d34f2e39d..20be7916484 100644
--- a/components/gfx/color.rs
+++ b/components/gfx/color.rs
@@ -7,6 +7,7 @@ use azure::azure_hl::Color as AzColor;
pub type Color = AzColor;
+#[inline]
pub fn rgb(r: u8, g: u8, b: u8) -> AzColor {
AzColor {
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 {
AzColor { r: r, g: g, b: b, a: a }
}
diff --git a/components/gfx/display_list/mod.rs b/components/gfx/display_list/mod.rs
index 7f8975a2ca6..d219ab26cca 100644
--- a/components/gfx/display_list/mod.rs
+++ b/components/gfx/display_list/mod.rs
@@ -159,6 +159,7 @@ pub enum StackingLevel {
}
impl StackingLevel {
+ #[inline]
pub fn from_background_and_border_level(level: BackgroundAndBorderLevel) -> StackingLevel {
match level {
RootOfStackingContextLevel => BackgroundAndBordersStackingLevel,
@@ -258,6 +259,7 @@ impl<'a> Iterator<&'a DisplayList> for DisplayListIterator<'a> {
impl DisplayList {
/// Creates a new display list.
+ #[inline]
pub fn new() -> DisplayList {
DisplayList {
list: DList::new(),
@@ -265,6 +267,7 @@ impl DisplayList {
}
/// Appends the given item to the display list.
+ #[inline]
pub fn push(&mut self, item: DisplayItem) {
self.list.push(item)
}
@@ -297,6 +300,7 @@ impl DisplayList {
}
/// Returns a preorder iterator over the given display list.
+ #[inline]
pub fn iter<'a>(&'a self) -> DisplayItemIterator<'a> {
ParentDisplayItemIterator(self.list.iter())
}
@@ -401,6 +405,7 @@ pub struct BaseDisplayItem {
}
impl BaseDisplayItem {
+ #[inline(always)]
pub fn new(bounds: Rect<Au>, node: OpaqueNode, level: StackingLevel, clip_rect: Rect<Au>)
-> BaseDisplayItem {
BaseDisplayItem {