~[] to Vec in main/compositing/compositor_layer.rs

This commit is contained in:
Matt Murphy 2014-04-22 20:07:35 -05:00 committed by Ms2ger
parent 60d443da16
commit 7073f3b645

View file

@ -65,7 +65,7 @@ pub struct CompositorLayer {
/// differs in scroll behavior from its parent. Each is associated with a /// differs in scroll behavior from its parent. Each is associated with a
/// ContainerLayer which determines its position relative to its parent and /// ContainerLayer which determines its position relative to its parent and
/// clipping rect. Children are stored in the order in which they are drawn. /// clipping rect. Children are stored in the order in which they are drawn.
pub children: ~[CompositorLayerChild], pub children: Vec<CompositorLayerChild>,
/// This layer's quadtree. This is where all buffers are stored for this layer. /// This layer's quadtree. This is where all buffers are stored for this layer.
pub quadtree: MaybeQuadtree, pub quadtree: MaybeQuadtree,
@ -170,7 +170,7 @@ impl CompositorLayer {
bounds: bounds, bounds: bounds,
page_size: page_size, page_size: page_size,
scroll_offset: Point2D(0f32, 0f32), scroll_offset: Point2D(0f32, 0f32),
children: ~[], children: Vec::new(),
quadtree: match page_size { quadtree: match page_size {
None => NoTree(tile_size, Some(MAX_TILE_MEMORY_PER_LAYER)), None => NoTree(tile_size, Some(MAX_TILE_MEMORY_PER_LAYER)),
Some(page_size) => { Some(page_size) => {
@ -203,7 +203,7 @@ impl CompositorLayer {
bounds: Rect(Point2D(0f32, 0f32), page_size), bounds: Rect(Point2D(0f32, 0f32), page_size),
page_size: Some(page_size), page_size: Some(page_size),
scroll_offset: Point2D(0f32, 0f32), scroll_offset: Point2D(0f32, 0f32),
children: ~[], children: Vec::new(),
quadtree: NoTree(tile_size, Some(MAX_TILE_MEMORY_PER_LAYER)), quadtree: NoTree(tile_size, Some(MAX_TILE_MEMORY_PER_LAYER)),
root_layer: Rc::new(ContainerLayer()), root_layer: Rc::new(ContainerLayer()),
hidden: false, hidden: false,
@ -494,7 +494,7 @@ impl CompositorLayer {
}) { }) {
Some(i) => { Some(i) => {
debug!("compositor_layer: node found for set_clipping_rect()"); debug!("compositor_layer: node found for set_clipping_rect()");
let child_node = &mut self.children[i]; let child_node = self.children.get_mut(i);
child_node.container.common.borrow_mut().set_transform( child_node.container.common.borrow_mut().set_transform(
identity().translate(new_rect.origin.x, new_rect.origin.y, 0.0)); identity().translate(new_rect.origin.x, new_rect.origin.y, 0.0));
let old_rect = child_node.container.scissor.borrow().clone(); let old_rect = child_node.container.scissor.borrow().clone();
@ -649,7 +649,7 @@ impl CompositorLayer {
}) { }) {
Some(i) => { Some(i) => {
debug!("compositor_layer: layer found for resize_helper()"); debug!("compositor_layer: layer found for resize_helper()");
let child_node = &mut self.children[i]; let child_node = self.children.get_mut(i);
let child = &mut child_node.child; let child = &mut child_node.child;
child.epoch = epoch; child.epoch = epoch;
child.page_size = Some(new_size); child.page_size = Some(new_size);