diff --git a/components/gfx/display_list/mod.rs b/components/gfx/display_list/mod.rs index c81afb19204..fc7ee4a989a 100644 --- a/components/gfx/display_list/mod.rs +++ b/components/gfx/display_list/mod.rs @@ -24,7 +24,7 @@ use azure::azure::AzFloat; use collections::dlist::{mod, DList}; use geom::{Point2D, Rect, SideOffsets2D, Size2D, Matrix2D}; use libc::uintptr_t; -use paint_task::RenderLayer; +use paint_task::PaintLayer; use script_traits::UntrustedNodeAddress; use servo_msg::compositor_msg::LayerId; use servo_net::image::base::Image; @@ -138,7 +138,7 @@ pub struct StackingContext { /// The display items that make up this stacking context. pub display_list: Box, /// The layer for this stacking context, if there is one. - pub layer: Option>, + pub layer: Option>, /// The position and size of this stacking context. pub bounds: Rect, /// The clipping rect for this stacking context, in the coordinate system of the *parent* @@ -160,7 +160,7 @@ impl StackingContext { bounds: Rect, z_index: i32, opacity: AzFloat, - layer: Option>) + layer: Option>) -> StackingContext { StackingContext { display_list: display_list, diff --git a/components/gfx/paint_task.rs b/components/gfx/paint_task.rs index 0c588c12ac5..1c78a2d2de9 100644 --- a/components/gfx/paint_task.rs +++ b/components/gfx/paint_task.rs @@ -40,7 +40,7 @@ use sync::Arc; /// Information about a hardware graphics layer that layout sends to the painting task. #[deriving(Clone)] -pub struct RenderLayer { +pub struct PaintLayer { /// A per-pipeline ID describing this layer that should be stable across reflows. pub id: LayerId, /// The color of the background in this layer. Used for unrendered content. @@ -49,10 +49,10 @@ pub struct RenderLayer { pub scroll_policy: ScrollPolicy, } -impl RenderLayer { - /// Creates a new `RenderLayer`. - pub fn new(id: LayerId, background_color: Color, scroll_policy: ScrollPolicy) -> RenderLayer { - RenderLayer { +impl PaintLayer { + /// Creates a new `PaintLayer`. + pub fn new(id: LayerId, background_color: Color, scroll_policy: ScrollPolicy) -> PaintLayer { + PaintLayer { id: id, background_color: background_color, scroll_policy: scroll_policy, @@ -147,16 +147,16 @@ fn initialize_layers(compositor: &mut C, let page_position = stacking_context.bounds.origin + *page_position; match stacking_context.layer { None => {} - Some(ref render_layer) => { + Some(ref paint_layer) => { metadata.push(LayerMetadata { - id: render_layer.id, + id: paint_layer.id, position: Rect(Point2D(page_position.x.to_nearest_px() as uint, page_position.y.to_nearest_px() as uint), Size2D(stacking_context.bounds.size.width.to_nearest_px() as uint, stacking_context.bounds.size.height.to_nearest_px() as uint)), - background_color: render_layer.background_color, - scroll_policy: render_layer.scroll_policy, + background_color: paint_layer.background_color, + scroll_policy: paint_layer.scroll_policy, }) } } diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs index 79866baa1ad..130ef0b8065 100644 --- a/components/layout/display_list_builder.rs +++ b/components/layout/display_list_builder.rs @@ -30,7 +30,7 @@ use gfx::display_list::{ImageDisplayItem, ImageDisplayItemClass, LineDisplayItem use gfx::display_list::{LineDisplayItemClass, PseudoDisplayItemClass, SidewaysLeft, SidewaysRight}; use gfx::display_list::{SolidColorDisplayItem, SolidColorDisplayItemClass, StackingContext}; use gfx::display_list::{TextDisplayItem, TextDisplayItemClass, Upright}; -use gfx::paint_task::RenderLayer; +use gfx::paint_task::PaintLayer; use servo_msg::compositor_msg::{FixedPosition, Scrollable}; use servo_msg::constellation_msg::{ConstellationChan, FrameRectMsg}; use servo_net::image::holder::ImageHolder; @@ -812,7 +812,7 @@ pub trait BlockFlowDisplayListBuilding { fn build_display_list_for_floating_block(&mut self, layout_context: &LayoutContext); fn create_stacking_context(&self, display_list: Box, - layer: Option>) + layer: Option>) -> Arc; } @@ -875,7 +875,7 @@ impl BlockFlowDisplayListBuilding for BlockFlow { let transparent = color::rgba(1.0, 1.0, 1.0, 0.0); let stacking_context = self.create_stacking_context(display_list, - Some(Arc::new(RenderLayer::new(self.layer_id(0), + Some(Arc::new(PaintLayer::new(self.layer_id(0), transparent, scroll_policy)))); self.base.display_list_building_result = StackingContextResult(stacking_context) @@ -897,7 +897,7 @@ impl BlockFlowDisplayListBuilding for BlockFlow { fn create_stacking_context(&self, display_list: Box, - layer: Option>) + layer: Option>) -> Arc { let bounds = Rect(self.base.stacking_relative_position, self.base.overflow.size.to_physical(self.base.writing_mode)); diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs index 9b5f4a00f22..058bd6e14ad 100644 --- a/components/layout/layout_task.rs +++ b/components/layout/layout_task.rs @@ -28,7 +28,7 @@ use geom::scale_factor::ScaleFactor; use gfx::color; use gfx::display_list::{DisplayList, OpaqueNode, StackingContext}; use gfx::font_cache_task::FontCacheTask; -use gfx::paint_task::{mod, RenderInitMsg, RenderChan, RenderLayer}; +use gfx::paint_task::{mod, RenderInitMsg, RenderChan, PaintLayer}; use layout_traits; use layout_traits::{LayoutControlMsg, LayoutTaskFactory}; use log; @@ -676,7 +676,7 @@ impl LayoutTask { let mut display_list = box DisplayList::new(); flow::mut_base(layout_root.deref_mut()).display_list_building_result .add_to(&mut *display_list); - let render_layer = Arc::new(RenderLayer::new(layout_root.layer_id(0), + let paint_layer = Arc::new(PaintLayer::new(layout_root.layer_id(0), color, Scrollable)); let origin = Rect(Point2D(Au(0), Au(0)), root_size); @@ -684,7 +684,7 @@ impl LayoutTask { origin, 0, 1.0, - Some(render_layer))); + Some(paint_layer))); rw_data.stacking_context = Some(stacking_context.clone());