mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Rename RenderLayer -> PaintLayer
This commit is contained in:
parent
d87def0743
commit
cee3d517e8
4 changed files with 19 additions and 19 deletions
|
@ -24,7 +24,7 @@ use azure::azure::AzFloat;
|
||||||
use collections::dlist::{mod, DList};
|
use collections::dlist::{mod, DList};
|
||||||
use geom::{Point2D, Rect, SideOffsets2D, Size2D, Matrix2D};
|
use geom::{Point2D, Rect, SideOffsets2D, Size2D, Matrix2D};
|
||||||
use libc::uintptr_t;
|
use libc::uintptr_t;
|
||||||
use paint_task::RenderLayer;
|
use paint_task::PaintLayer;
|
||||||
use script_traits::UntrustedNodeAddress;
|
use script_traits::UntrustedNodeAddress;
|
||||||
use servo_msg::compositor_msg::LayerId;
|
use servo_msg::compositor_msg::LayerId;
|
||||||
use servo_net::image::base::Image;
|
use servo_net::image::base::Image;
|
||||||
|
@ -138,7 +138,7 @@ pub struct StackingContext {
|
||||||
/// The display items that make up this stacking context.
|
/// The display items that make up this stacking context.
|
||||||
pub display_list: Box<DisplayList>,
|
pub display_list: Box<DisplayList>,
|
||||||
/// The layer for this stacking context, if there is one.
|
/// The layer for this stacking context, if there is one.
|
||||||
pub layer: Option<Arc<RenderLayer>>,
|
pub layer: Option<Arc<PaintLayer>>,
|
||||||
/// The position and size of this stacking context.
|
/// The position and size of this stacking context.
|
||||||
pub bounds: Rect<Au>,
|
pub bounds: Rect<Au>,
|
||||||
/// The clipping rect for this stacking context, in the coordinate system of the *parent*
|
/// The clipping rect for this stacking context, in the coordinate system of the *parent*
|
||||||
|
@ -160,7 +160,7 @@ impl StackingContext {
|
||||||
bounds: Rect<Au>,
|
bounds: Rect<Au>,
|
||||||
z_index: i32,
|
z_index: i32,
|
||||||
opacity: AzFloat,
|
opacity: AzFloat,
|
||||||
layer: Option<Arc<RenderLayer>>)
|
layer: Option<Arc<PaintLayer>>)
|
||||||
-> StackingContext {
|
-> StackingContext {
|
||||||
StackingContext {
|
StackingContext {
|
||||||
display_list: display_list,
|
display_list: display_list,
|
||||||
|
|
|
@ -40,7 +40,7 @@ use sync::Arc;
|
||||||
|
|
||||||
/// Information about a hardware graphics layer that layout sends to the painting task.
|
/// Information about a hardware graphics layer that layout sends to the painting task.
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
pub struct RenderLayer {
|
pub struct PaintLayer {
|
||||||
/// A per-pipeline ID describing this layer that should be stable across reflows.
|
/// A per-pipeline ID describing this layer that should be stable across reflows.
|
||||||
pub id: LayerId,
|
pub id: LayerId,
|
||||||
/// The color of the background in this layer. Used for unrendered content.
|
/// The color of the background in this layer. Used for unrendered content.
|
||||||
|
@ -49,10 +49,10 @@ pub struct RenderLayer {
|
||||||
pub scroll_policy: ScrollPolicy,
|
pub scroll_policy: ScrollPolicy,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RenderLayer {
|
impl PaintLayer {
|
||||||
/// Creates a new `RenderLayer`.
|
/// Creates a new `PaintLayer`.
|
||||||
pub fn new(id: LayerId, background_color: Color, scroll_policy: ScrollPolicy) -> RenderLayer {
|
pub fn new(id: LayerId, background_color: Color, scroll_policy: ScrollPolicy) -> PaintLayer {
|
||||||
RenderLayer {
|
PaintLayer {
|
||||||
id: id,
|
id: id,
|
||||||
background_color: background_color,
|
background_color: background_color,
|
||||||
scroll_policy: scroll_policy,
|
scroll_policy: scroll_policy,
|
||||||
|
@ -147,16 +147,16 @@ fn initialize_layers<C>(compositor: &mut C,
|
||||||
let page_position = stacking_context.bounds.origin + *page_position;
|
let page_position = stacking_context.bounds.origin + *page_position;
|
||||||
match stacking_context.layer {
|
match stacking_context.layer {
|
||||||
None => {}
|
None => {}
|
||||||
Some(ref render_layer) => {
|
Some(ref paint_layer) => {
|
||||||
metadata.push(LayerMetadata {
|
metadata.push(LayerMetadata {
|
||||||
id: render_layer.id,
|
id: paint_layer.id,
|
||||||
position:
|
position:
|
||||||
Rect(Point2D(page_position.x.to_nearest_px() as uint,
|
Rect(Point2D(page_position.x.to_nearest_px() as uint,
|
||||||
page_position.y.to_nearest_px() as uint),
|
page_position.y.to_nearest_px() as uint),
|
||||||
Size2D(stacking_context.bounds.size.width.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)),
|
stacking_context.bounds.size.height.to_nearest_px() as uint)),
|
||||||
background_color: render_layer.background_color,
|
background_color: paint_layer.background_color,
|
||||||
scroll_policy: render_layer.scroll_policy,
|
scroll_policy: paint_layer.scroll_policy,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ use gfx::display_list::{ImageDisplayItem, ImageDisplayItemClass, LineDisplayItem
|
||||||
use gfx::display_list::{LineDisplayItemClass, PseudoDisplayItemClass, SidewaysLeft, SidewaysRight};
|
use gfx::display_list::{LineDisplayItemClass, PseudoDisplayItemClass, SidewaysLeft, SidewaysRight};
|
||||||
use gfx::display_list::{SolidColorDisplayItem, SolidColorDisplayItemClass, StackingContext};
|
use gfx::display_list::{SolidColorDisplayItem, SolidColorDisplayItemClass, StackingContext};
|
||||||
use gfx::display_list::{TextDisplayItem, TextDisplayItemClass, Upright};
|
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::compositor_msg::{FixedPosition, Scrollable};
|
||||||
use servo_msg::constellation_msg::{ConstellationChan, FrameRectMsg};
|
use servo_msg::constellation_msg::{ConstellationChan, FrameRectMsg};
|
||||||
use servo_net::image::holder::ImageHolder;
|
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 build_display_list_for_floating_block(&mut self, layout_context: &LayoutContext);
|
||||||
fn create_stacking_context(&self,
|
fn create_stacking_context(&self,
|
||||||
display_list: Box<DisplayList>,
|
display_list: Box<DisplayList>,
|
||||||
layer: Option<Arc<RenderLayer>>)
|
layer: Option<Arc<PaintLayer>>)
|
||||||
-> Arc<StackingContext>;
|
-> Arc<StackingContext>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -875,7 +875,7 @@ impl BlockFlowDisplayListBuilding for BlockFlow {
|
||||||
let transparent = color::rgba(1.0, 1.0, 1.0, 0.0);
|
let transparent = color::rgba(1.0, 1.0, 1.0, 0.0);
|
||||||
let stacking_context =
|
let stacking_context =
|
||||||
self.create_stacking_context(display_list,
|
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,
|
transparent,
|
||||||
scroll_policy))));
|
scroll_policy))));
|
||||||
self.base.display_list_building_result = StackingContextResult(stacking_context)
|
self.base.display_list_building_result = StackingContextResult(stacking_context)
|
||||||
|
@ -897,7 +897,7 @@ impl BlockFlowDisplayListBuilding for BlockFlow {
|
||||||
|
|
||||||
fn create_stacking_context(&self,
|
fn create_stacking_context(&self,
|
||||||
display_list: Box<DisplayList>,
|
display_list: Box<DisplayList>,
|
||||||
layer: Option<Arc<RenderLayer>>)
|
layer: Option<Arc<PaintLayer>>)
|
||||||
-> Arc<StackingContext> {
|
-> Arc<StackingContext> {
|
||||||
let bounds = Rect(self.base.stacking_relative_position,
|
let bounds = Rect(self.base.stacking_relative_position,
|
||||||
self.base.overflow.size.to_physical(self.base.writing_mode));
|
self.base.overflow.size.to_physical(self.base.writing_mode));
|
||||||
|
|
|
@ -28,7 +28,7 @@ use geom::scale_factor::ScaleFactor;
|
||||||
use gfx::color;
|
use gfx::color;
|
||||||
use gfx::display_list::{DisplayList, OpaqueNode, StackingContext};
|
use gfx::display_list::{DisplayList, OpaqueNode, StackingContext};
|
||||||
use gfx::font_cache_task::FontCacheTask;
|
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;
|
||||||
use layout_traits::{LayoutControlMsg, LayoutTaskFactory};
|
use layout_traits::{LayoutControlMsg, LayoutTaskFactory};
|
||||||
use log;
|
use log;
|
||||||
|
@ -676,7 +676,7 @@ impl LayoutTask {
|
||||||
let mut display_list = box DisplayList::new();
|
let mut display_list = box DisplayList::new();
|
||||||
flow::mut_base(layout_root.deref_mut()).display_list_building_result
|
flow::mut_base(layout_root.deref_mut()).display_list_building_result
|
||||||
.add_to(&mut *display_list);
|
.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,
|
color,
|
||||||
Scrollable));
|
Scrollable));
|
||||||
let origin = Rect(Point2D(Au(0), Au(0)), root_size);
|
let origin = Rect(Point2D(Au(0), Au(0)), root_size);
|
||||||
|
@ -684,7 +684,7 @@ impl LayoutTask {
|
||||||
origin,
|
origin,
|
||||||
0,
|
0,
|
||||||
1.0,
|
1.0,
|
||||||
Some(render_layer)));
|
Some(paint_layer)));
|
||||||
|
|
||||||
rw_data.stacking_context = Some(stacking_context.clone());
|
rw_data.stacking_context = Some(stacking_context.clone());
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue