diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/components/compositing/compositing.rs | 6 | ||||
-rw-r--r-- | src/components/compositing/compositor.rs | 66 | ||||
-rw-r--r-- | src/components/compositing/compositor_data.rs | 124 | ||||
-rw-r--r-- | src/components/compositing/compositor_task.rs | 2 | ||||
-rw-r--r-- | src/components/compositing/constellation.rs | 2 | ||||
-rw-r--r-- | src/components/compositing/platform/common/glfw_windowing.rs | 22 | ||||
-rw-r--r-- | src/components/embedding/embedding.rs | 2 | ||||
-rw-r--r-- | src/components/embedding/types.rs | 7 | ||||
-rw-r--r-- | src/components/gfx/platform/linux/font.rs | 2 | ||||
-rw-r--r-- | src/components/gfx/text/shaping/harfbuzz.rs | 2 | ||||
-rw-r--r-- | src/components/layout/block.rs | 4 | ||||
-rw-r--r-- | src/components/layout/flow_list.rs | 15 | ||||
-rw-r--r-- | src/components/script/dom/bindings/callback.rs | 4 | ||||
-rw-r--r-- | src/components/style/selectors.rs | 18 | ||||
-rw-r--r-- | src/components/style/stylesheets.rs | 5 | ||||
m--------- | src/support/layers/rust-layers | 0 |
16 files changed, 143 insertions, 138 deletions
diff --git a/src/components/compositing/compositing.rs b/src/components/compositing/compositing.rs index 737acce3b84..b944567549d 100644 --- a/src/components/compositing/compositing.rs +++ b/src/components/compositing/compositing.rs @@ -47,15 +47,15 @@ extern crate core_text; pub use compositor_task::{CompositorChan, CompositorTask}; pub use constellation::Constellation; -mod compositor_task; +pub mod compositor_task; mod compositor_data; mod compositor; mod headless; -mod pipeline; -mod constellation; +pub mod pipeline; +pub mod constellation; mod windowing; diff --git a/src/components/compositing/compositor.rs b/src/components/compositing/compositor.rs index f91cde8f1fd..26f15b126af 100644 --- a/src/components/compositing/compositor.rs +++ b/src/components/compositing/compositor.rs @@ -31,7 +31,7 @@ use layers::platform::surface::NativeCompositingGraphicsContext; use layers::rendergl; use layers::rendergl::RenderContext; use layers::scene::Scene; -use layers::layers::ContainerLayer; +use layers::layers::Layer; use opengles::gl2; use png; use servo_msg::compositor_msg::{Blank, Epoch, FinishedLoading, IdleRenderState}; @@ -135,8 +135,8 @@ impl IOCompositor { // Create an initial layer tree. // - // TODO: There should be no initial layer tree until the renderer creates one from the display - // list. This is only here because we don't have that logic in the renderer yet. + // TODO: There should be no initial layer tree until the renderer creates one from the + // display list. This is only here because we don't have that logic in the renderer yet. let window_size = window.framebuffer_size(); let hidpi_factor = window.hidpi_factor(); @@ -285,7 +285,10 @@ impl IOCompositor { (Ok(CreateRootCompositorLayerIfNecessary(pipeline_id, layer_id, size, color)), false) => { - self.create_root_compositor_layer_if_necessary(pipeline_id, layer_id, size, color); + self.create_root_compositor_layer_if_necessary(pipeline_id, + layer_id, + size, + color); } (Ok(CreateDescendantCompositorLayerIfNecessary(pipeline_id, @@ -336,7 +339,10 @@ impl IOCompositor { fn set_unrendered_color(&mut self, pipeline_id: PipelineId, layer_id: LayerId, color: Color) { match self.scene.root { - Some(ref layer) => CompositorData::set_unrendered_color(layer.clone(), pipeline_id, layer_id, color), + Some(ref layer) => CompositorData::set_unrendered_color(layer.clone(), + pipeline_id, + layer_id, + color), None => false, }; } @@ -361,7 +367,8 @@ impl IOCompositor { unrendered_color: Color) { let (root_pipeline, root_layer_id) = match self.scene.root { Some(ref root_layer) if root_layer.extra_data.borrow().pipeline.id == id => { - (root_layer.extra_data.borrow().pipeline.clone(), CompositorData::id_of_first_child(root_layer.clone())) + (root_layer.extra_data.borrow().pipeline.clone(), + CompositorData::id_of_first_child(root_layer.clone())) } _ => { match self.root_pipeline { @@ -375,9 +382,12 @@ impl IOCompositor { if layer_id != root_layer_id { let root_pipeline_id = root_pipeline.id; - let new_root = Rc::new(ContainerLayer::new(Some(size), self.opts.tile_size, - CompositorData::new_root(root_pipeline, - size, self.opts.cpu_painting))); + let new_compositor_data = CompositorData::new_root(root_pipeline, + size, + self.opts.cpu_painting); + let new_root = Rc::new(Layer::new(size, + self.opts.tile_size, + new_compositor_data)); new_root.extra_data.borrow_mut().unrendered_color = unrendered_color; let parent_layer_id = new_root.extra_data.borrow().id; @@ -448,7 +458,12 @@ impl IOCompositor { let page_window = self.page_window(); let (ask, move): (bool, bool) = match self.scene.root { Some(ref layer) => { - CompositorData::resize(layer.clone(), pipeline_id, layer_id, new_size, page_window, epoch); + CompositorData::resize(layer.clone(), + pipeline_id, + layer_id, + new_size, + page_window, + epoch); let move = self.fragment_point.take().map_or(false, |point| { CompositorData::move(layer.clone(), pipeline_id, layer_id, point, page_window) }); @@ -470,7 +485,10 @@ impl IOCompositor { new_rect: Rect<f32>) { let ask: bool = match self.scene.root { Some(ref layer) => { - assert!(CompositorData::set_clipping_rect(layer.clone(), pipeline_id, layer_id, new_rect)); + assert!(CompositorData::set_clipping_rect(layer.clone(), + pipeline_id, + layer_id, + new_rect)); true } None => { @@ -519,8 +537,10 @@ impl IOCompositor { point: Point2D<f32>) { let page_window = self.page_window(); let (ask, move): (bool, bool) = match self.scene.root { - Some(ref layer) if layer.extra_data.borrow().pipeline.id == pipeline_id && !layer.extra_data.borrow().hidden => { - (true, CompositorData::move(layer.clone(), pipeline_id, layer_id, point, page_window)) + Some(ref layer) if layer.extra_data.borrow().pipeline.id == pipeline_id && + !layer.extra_data.borrow().hidden => { + (true, + CompositorData::move(layer.clone(), pipeline_id, layer_id, point, page_window)) } Some(_) | None => { self.fragment_point = Some(point); @@ -615,7 +635,8 @@ impl IOCompositor { self.load_complete = false; let root_pipeline_id = match self.scene.root { Some(ref layer) => layer.extra_data.borrow().pipeline.id.clone(), - None => fail!("Compositor: Received LoadUrlWindowEvent without initialized compositor layers"), + None => fail!("Compositor: Received LoadUrlWindowEvent without initialized compositor \ + layers"), }; let msg = LoadUrlMsg(root_pipeline_id, url::parse_url(url_string.as_slice(), None)); @@ -652,7 +673,10 @@ impl IOCompositor { let page_window = self.page_window(); let mut scroll = false; for layer in self.scene.root.mut_iter() { - scroll = CompositorData::handle_scroll_event(layer.clone(), page_delta, page_cursor, page_window) || scroll; + scroll = CompositorData::handle_scroll_event(layer.clone(), + page_delta, + page_cursor, + page_window) || scroll; } self.recomposite_if(scroll); self.ask_for_tiles(); @@ -703,7 +727,10 @@ impl IOCompositor { let page_window = self.page_window(); for layer in self.scene.root.mut_iter() { - CompositorData::handle_scroll_event(layer.clone(), page_delta, page_cursor, page_window); + CompositorData::handle_scroll_event(layer.clone(), + page_delta, + page_cursor, + page_window); } self.recomposite = true; @@ -728,8 +755,8 @@ impl IOCompositor { let recomposite = CompositorData::get_buffer_request(layer.clone(), &self.graphics_context, rect, - scale.get()) || self.recomposite; - self.recomposite = recomposite; + scale.get()); + self.recomposite = self.recomposite || recomposite; } else { debug!("Compositor: root layer is hidden!"); } @@ -771,8 +798,9 @@ impl IOCompositor { let dst_start = y * stride; let src_start = (height - y - 1) * stride; unsafe { + let src_slice = orig_pixels.slice(src_start, src_start + stride); pixels.mut_slice(dst_start, dst_start + stride) - .copy_memory(orig_pixels.slice(src_start, src_start + stride).slice_to(stride)); + .copy_memory(src_slice.slice_to(stride)); } } let img = png::Image { diff --git a/src/components/compositing/compositor_data.rs b/src/components/compositing/compositor_data.rs index 60505414a67..a91637f054e 100644 --- a/src/components/compositing/compositor_data.rs +++ b/src/components/compositing/compositor_data.rs @@ -14,7 +14,7 @@ use geom::rect::{Rect, TypedRect}; use geom::size::{Size2D, TypedSize2D}; use gfx::render_task::{ReRenderMsg, UnusedBufferMsg}; use gfx; -use layers::layers::{ContainerLayer, Flip, LayerBuffer, LayerBufferSet, NoFlip, TextureLayer}; +use layers::layers::{Layer, Flip, LayerBuffer, LayerBufferSet, NoFlip, TextureLayer}; use layers::quadtree::{Tile, Normal, Hidden}; use layers::platform::surface::{NativeCompositingGraphicsContext, NativeSurfaceMethods}; use layers::texturegl::{Texture, TextureTarget}; @@ -139,8 +139,8 @@ impl CompositorData { } - pub fn id_of_first_child(layer: Rc<ContainerLayer<CompositorData>>) -> LayerId { - layer.children().next().expect("no first child!").extra_data.borrow().id + pub fn id_of_first_child(layer: Rc<Layer<CompositorData>>) -> LayerId { + layer.children().iter().next().expect("no first child!").extra_data.borrow().id } /// Adds a child layer to the layer with the given ID and the given pipeline, if it doesn't @@ -152,7 +152,7 @@ impl CompositorData { /// * True if the layer was not added because it already existed; /// * False if the layer could not be added because no suitable parent layer with the given /// ID and pipeline could be found. - pub fn add_child_if_necessary(layer: Rc<ContainerLayer<CompositorData>>, + pub fn add_child_if_necessary(layer: Rc<Layer<CompositorData>>, pipeline_id: PipelineId, parent_layer_id: LayerId, child_layer_id: LayerId, @@ -161,8 +161,8 @@ impl CompositorData { scroll_policy: ScrollPolicy) -> bool { if layer.extra_data.borrow().pipeline.id != pipeline_id || layer.extra_data.borrow().id != parent_layer_id { - return layer.children().any(|kid| { - CompositorData::add_child_if_necessary(kid, + return layer.children().iter().any(|kid| { + CompositorData::add_child_if_necessary(kid.clone(), pipeline_id, parent_layer_id, child_layer_id, @@ -173,7 +173,7 @@ impl CompositorData { } // See if we've already made this child layer. - if layer.children().any(|kid| { + if layer.children().iter().any(|kid| { kid.extra_data.borrow().pipeline.id == pipeline_id && kid.extra_data.borrow().id == child_layer_id }) { @@ -188,15 +188,15 @@ impl CompositorData { DoesntWantScrollEvents, scroll_policy, false); - let new_kid = Rc::new(ContainerLayer::new(Some(page_size), - ContainerLayer::tile_size(layer.clone()), - new_compositor_data)); + let new_kid = Rc::new(Layer::new(page_size, + Layer::tile_size(layer.clone()), + new_compositor_data)); new_kid.extra_data.borrow_mut().scissor = Some(rect); - new_kid.common.borrow_mut().origin = rect.origin; + *new_kid.origin.borrow_mut() = rect.origin; // Place the kid's layer in the container passed in. - ContainerLayer::add_child_end(layer.clone(), new_kid.clone()); + Layer::add_child(layer.clone(), new_kid.clone()); true } @@ -205,7 +205,7 @@ impl CompositorData { /// specified amount in page coordinates. This also takes in a cursor position to see if the /// mouse is over child layers first. If a layer successfully scrolled, returns true; otherwise /// returns false, so a parent layer can scroll instead. - pub fn handle_scroll_event(layer: Rc<ContainerLayer<CompositorData>>, + pub fn handle_scroll_event(layer: Rc<Layer<CompositorData>>, delta: TypedPoint2D<PagePx, f32>, cursor: TypedPoint2D<PagePx, f32>, window_size: TypedSize2D<PagePx, f32>) @@ -223,7 +223,7 @@ impl CompositorData { // Allow children to scroll. let cursor = cursor - layer.extra_data.borrow().scroll_offset; - for child in layer.children() { + for child in layer.children().iter() { match child.extra_data.borrow().scissor { None => { error!("CompositorData: unable to perform cursor hit test for layer"); @@ -272,7 +272,7 @@ impl CompositorData { /// Actually scrolls the descendants of a layer that scroll. This is called by /// `handle_scroll_event` above when it determines that a layer wants to scroll. - fn scroll(layer: Rc<ContainerLayer<CompositorData>>, + fn scroll(layer: Rc<Layer<CompositorData>>, scroll_offset: TypedPoint2D<PagePx, f32>) -> bool { let mut result = false; @@ -283,13 +283,12 @@ impl CompositorData { layer.extra_data.borrow_mut().scroll_offset = scroll_offset; let scroll_offset = layer.extra_data.borrow().scroll_offset.clone(); - layer.common.borrow_mut().set_transform( - identity().translate(scroll_offset.x.get(), scroll_offset.y.get(), 0.0)); + *layer.transform.borrow_mut() = identity().translate(scroll_offset.x.get(), scroll_offset.y.get(), 0.0); result = true } - for child in layer.children() { + for child in layer.children().iter() { result = CompositorData::scroll(child.clone(), scroll_offset) || result; } @@ -299,10 +298,10 @@ impl CompositorData { // Takes in a MouseWindowEvent, determines if it should be passed to children, and // sends the event off to the appropriate pipeline. NB: the cursor position is in // page coordinates. - pub fn send_mouse_event(layer: Rc<ContainerLayer<CompositorData>>, + pub fn send_mouse_event(layer: Rc<Layer<CompositorData>>, event: MouseWindowEvent, cursor: TypedPoint2D<PagePx, f32>) { let cursor = cursor - layer.extra_data.borrow().scroll_offset; - for child in layer.children() { + for child in layer.children().iter() { if child.extra_data.borrow().hidden { continue; } @@ -332,7 +331,7 @@ impl CompositorData { let _ = chan.send_opt(SendEventMsg(layer.extra_data.borrow().pipeline.id.clone(), message)); } - pub fn send_mouse_move_event(layer: Rc<ContainerLayer<CompositorData>>, + pub fn send_mouse_move_event(layer: Rc<Layer<CompositorData>>, cursor: TypedPoint2D<PagePx, f32>) { let message = MouseMoveEvent(cursor.to_untyped()); let ScriptChan(ref chan) = layer.extra_data.borrow().pipeline.script_chan; @@ -341,14 +340,12 @@ impl CompositorData { // Given the current window size, determine which tiles need to be (re-)rendered and sends them // off the the appropriate renderer. Returns true if and only if the scene should be repainted. - pub fn get_buffer_request(layer: Rc<ContainerLayer<CompositorData>>, + pub fn get_buffer_request(layer: Rc<Layer<CompositorData>>, graphics_context: &NativeCompositingGraphicsContext, window_rect: Rect<f32>, scale: f32) -> bool { - let (request, unused) = ContainerLayer::get_tile_rects_page(layer.clone(), - window_rect, - scale); + let (request, unused) = Layer::get_tile_rects_page(layer.clone(), window_rect, scale); let redisplay = !unused.is_empty(); if redisplay { // Send back unused tiles. @@ -371,7 +368,7 @@ impl CompositorData { CompositorData::build_layer_tree(layer.clone(), graphics_context); } - let transform = |kid: Rc<ContainerLayer<CompositorData>>| -> bool { + let get_child_buffer_request = |kid: &Rc<Layer<CompositorData>>| -> bool { match kid.extra_data.borrow().scissor { Some(scissor) => { let mut new_rect = window_rect; @@ -399,17 +396,16 @@ impl CompositorData { } }; - layer.children().filter(|x| !x.extra_data.borrow().hidden) - .map(transform) - .fold(false, |a, b| a || b) || redisplay - + layer.children().iter().filter(|x| !x.extra_data.borrow().hidden) + .map(get_child_buffer_request) + .any(|b| b) || redisplay } // Move the sublayer to an absolute position in page coordinates relative to its parent, // and clip the layer to the specified size in page coordinates. // If the layer is hidden and has a defined page size, unhide it. // This method returns false if the specified layer is not found. - pub fn set_clipping_rect(layer: Rc<ContainerLayer<CompositorData>>, + pub fn set_clipping_rect(layer: Rc<Layer<CompositorData>>, pipeline_id: PipelineId, layer_id: LayerId, new_rect: Rect<f32>) @@ -420,18 +416,18 @@ impl CompositorData { layer_id) { Some(child_node) => { debug!("compositor_data: node found for set_clipping_rect()"); - child_node.common.borrow_mut().origin = new_rect.origin; + *child_node.origin.borrow_mut() = new_rect.origin; let old_rect = child_node.extra_data.borrow().scissor.clone(); child_node.extra_data.borrow_mut().scissor = Some(new_rect); match old_rect { Some(old_rect) => { // Rect is unhidden - ContainerLayer::set_status_page(layer.clone(), old_rect, Normal, false); + Layer::set_status_page(layer.clone(), old_rect, Normal, false); } None => {} // Nothing to do } // Hide the new rect - ContainerLayer::set_status_page(layer.clone(), new_rect, Hidden, false); + Layer::set_status_page(layer.clone(), new_rect, Hidden, false); // If possible, unhide child let mut child_data = child_node.extra_data.borrow_mut(); @@ -441,7 +437,7 @@ impl CompositorData { true } None => { - layer.children() + layer.children().iter() .any(|kid| CompositorData::set_clipping_rect(kid.clone(), pipeline_id, layer_id, @@ -454,7 +450,7 @@ impl CompositorData { // Set the layer's page size. This signals that the renderer is ready for BufferRequests. // If the layer is hidden and has a defined clipping rect, unhide it. // This method returns false if the specified layer is not found. - pub fn resize(layer: Rc<ContainerLayer<CompositorData>>, + pub fn resize(layer: Rc<Layer<CompositorData>>, pipeline_id: PipelineId, layer_id: LayerId, new_size: Size2D<f32>, @@ -475,7 +471,7 @@ impl CompositorData { layer.extra_data.borrow_mut().epoch = epoch; layer.extra_data.borrow_mut().page_size = Some(new_size); - let unused_buffers = ContainerLayer::resize(layer.clone(), new_size); + let unused_buffers = Layer::resize(layer.clone(), new_size); if !unused_buffers.is_empty() { let _ = layer.extra_data.borrow().pipeline .render_chan @@ -493,7 +489,7 @@ impl CompositorData { true } - pub fn move(layer: Rc<ContainerLayer<CompositorData>>, + pub fn move(layer: Rc<Layer<CompositorData>>, pipeline_id: PipelineId, layer_id: LayerId, origin: Point2D<f32>, @@ -502,7 +498,7 @@ impl CompositorData { // Search children for the right layer to move. if layer.extra_data.borrow().pipeline.id != pipeline_id || layer.extra_data.borrow().id != layer_id { - return layer.children().any(|kid| { + return layer.children().iter().any(|kid| { CompositorData::move(kid.clone(), pipeline_id, layer_id, origin, window_size) }); } @@ -567,21 +563,21 @@ impl CompositorData { - fn find_child_with_layer_and_pipeline_id(layer: Rc<ContainerLayer<CompositorData>>, + fn find_child_with_layer_and_pipeline_id(layer: Rc<Layer<CompositorData>>, pipeline_id: PipelineId, layer_id: LayerId) - -> Option<Rc<ContainerLayer<CompositorData>>> { - for kid in layer.children() { + -> Option<Rc<Layer<CompositorData>>> { + for kid in layer.children().iter() { if pipeline_id == kid.extra_data.borrow().pipeline.id && layer_id == kid.extra_data.borrow().id { - return Some(kid); + return Some(kid.clone()); } } return None } // A helper method to resize sublayers. - fn resize_helper(layer: Rc<ContainerLayer<CompositorData>>, + fn resize_helper(layer: Rc<Layer<CompositorData>>, pipeline_id: PipelineId, layer_id: LayerId, new_size: Size2D<f32>, @@ -597,7 +593,7 @@ impl CompositorData { child.extra_data.borrow_mut().epoch = epoch; child.extra_data.borrow_mut().page_size = Some(new_size); - let unused_buffers = ContainerLayer::resize(child.clone(), new_size); + let unused_buffers = Layer::resize(child.clone(), new_size); if !unused_buffers.is_empty() { let msg = UnusedBufferMsg(unused_buffers); let _ = child.extra_data.borrow().pipeline.render_chan.send_opt(msg); @@ -629,20 +625,20 @@ impl CompositorData { // If we got here, the layer's ID does not match ours, so recurse on descendents (including // hidden children). - layer.children().any(|kid| { + layer.children().iter().any(|kid| { CompositorData::resize_helper(kid.clone(), pipeline_id, layer_id, new_size, epoch) }) } // Collect buffers from the quadtree. This method IS NOT recursive, so child layers // are not rebuilt directly from this method. - pub fn build_layer_tree(layer: Rc<ContainerLayer<CompositorData>>, + pub fn build_layer_tree(layer: Rc<Layer<CompositorData>>, graphics_context: &NativeCompositingGraphicsContext) { // Clear all old textures. layer.tiles.borrow_mut().clear(); // Add new tiles. - ContainerLayer::do_for_all_tiles(layer.clone(), |buffer: &Box<LayerBuffer>| { + Layer::do_for_all_tiles(layer.clone(), |buffer: &Box<LayerBuffer>| { debug!("osmain: compositing buffer rect {}", buffer.rect); let size = Size2D(buffer.screen_pos.size.width as int, @@ -680,7 +676,7 @@ impl CompositorData { // // If the epoch of the message does not match the layer's epoch, the message is ignored, the // layer buffer set is consumed, and None is returned. - pub fn add_buffers(layer: Rc<ContainerLayer<CompositorData>>, + pub fn add_buffers(layer: Rc<Layer<CompositorData>>, graphics_context: &NativeCompositingGraphicsContext, pipeline_id: PipelineId, layer_id: LayerId, @@ -691,7 +687,7 @@ impl CompositorData { if layer.extra_data.borrow().pipeline.id != pipeline_id || layer.extra_data.borrow().id != layer_id { // ID does not match ours, so recurse on descendents (including hidden children). - for child_layer in layer.children() { + for child_layer in layer.children().iter() { match CompositorData::add_buffers(child_layer.clone(), graphics_context, pipeline_id, @@ -722,7 +718,7 @@ impl CompositorData { { let mut unused_tiles = vec!(); for buffer in new_buffers.buffers.move_iter().rev() { - unused_tiles.push_all_move(ContainerLayer::add_tile_pixel(layer.clone(), buffer)); + unused_tiles.push_all_move(Layer::add_tile_pixel(layer.clone(), buffer)); } if !unused_tiles.is_empty() { // send back unused buffers let msg = UnusedBufferMsg(unused_tiles); @@ -736,19 +732,19 @@ impl CompositorData { // Recursively sets occluded portions of quadtrees to Hidden, so that they do not ask for // tile requests. If layers are moved, resized, or deleted, these portions may be updated. - fn set_occlusions(layer: Rc<ContainerLayer<CompositorData>>) { - for kid in layer.children() { + fn set_occlusions(layer: Rc<Layer<CompositorData>>) { + for kid in layer.children().iter() { if !kid.extra_data.borrow().hidden { match kid.extra_data.borrow().scissor { None => {} // Nothing to do Some(rect) => { - ContainerLayer::set_status_page(layer.clone(), rect, Hidden, false); + Layer::set_status_page(layer.clone(), rect, Hidden, false); } } } } - for kid in layer.children() { + for kid in layer.children().iter() { if !kid.extra_data.borrow().hidden { CompositorData::set_occlusions(kid.clone()); } @@ -757,8 +753,8 @@ impl CompositorData { /// Destroys all quadtree tiles, sending the buffers back to the renderer to be destroyed or /// reused. - fn clear(layer: Rc<ContainerLayer<CompositorData>>) { - let mut tiles = ContainerLayer::collect_tiles(layer.clone()); + fn clear(layer: Rc<Layer<CompositorData>>) { + let mut tiles = Layer::collect_tiles(layer.clone()); if !tiles.is_empty() { // We have no way of knowing without a race whether the render task is even up and @@ -774,9 +770,9 @@ impl CompositorData { /// Destroys tiles for this layer and all descendent layers, sending the buffers back to the /// renderer to be destroyed or reused. - pub fn clear_all_tiles(layer: Rc<ContainerLayer<CompositorData>>) { + pub fn clear_all_tiles(layer: Rc<Layer<CompositorData>>) { CompositorData::clear(layer.clone()); - for kid in layer.children() { + for kid in layer.children().iter() { CompositorData::clear_all_tiles(kid.clone()); } } @@ -786,26 +782,26 @@ impl CompositorData { /// otherwise, you will leak tiles. /// /// This is used during shutdown, when we know the render task is going away. - pub fn forget_all_tiles(layer: Rc<ContainerLayer<CompositorData>>) { - let tiles = ContainerLayer::collect_tiles(layer.clone()); + pub fn forget_all_tiles(layer: Rc<Layer<CompositorData>>) { + let tiles = Layer::collect_tiles(layer.clone()); for tile in tiles.move_iter() { let mut tile = tile; tile.mark_wont_leak() } - for kid in layer.children() { + for kid in layer.children().iter() { CompositorData::forget_all_tiles(kid.clone()); } } - pub fn set_unrendered_color(layer: Rc<ContainerLayer<CompositorData>>, + pub fn set_unrendered_color(layer: Rc<Layer<CompositorData>>, pipeline_id: PipelineId, layer_id: LayerId, color: Color) -> bool { if layer.extra_data.borrow().pipeline.id != pipeline_id || layer.extra_data.borrow().id != layer_id { - for child_layer in layer.children() { + for child_layer in layer.children().iter() { if CompositorData::set_unrendered_color(child_layer.clone(), pipeline_id, layer_id, diff --git a/src/components/compositing/compositor_task.rs b/src/components/compositing/compositor_task.rs index faf34915a84..1b8e9653744 100644 --- a/src/components/compositing/compositor_task.rs +++ b/src/components/compositing/compositor_task.rs @@ -6,7 +6,7 @@ pub use windowing; use compositor; use headless; -use constellation::SendableFrameTree; +pub use constellation::SendableFrameTree; use windowing::{ApplicationMethods, WindowMethods}; use platform::Application; diff --git a/src/components/compositing/constellation.rs b/src/components/compositing/constellation.rs index f5215be1555..f6d12ebcedd 100644 --- a/src/components/compositing/constellation.rs +++ b/src/components/compositing/constellation.rs @@ -42,7 +42,7 @@ pub struct Constellation { pub compositor_chan: CompositorChan, pub resource_task: ResourceTask, pub image_cache_task: ImageCacheTask, - pub pipelines: HashMap<PipelineId, Rc<Pipeline>>, + pipelines: HashMap<PipelineId, Rc<Pipeline>>, navigation_context: NavigationContext, next_pipeline_id: PipelineId, pending_frames: Vec<FrameChange>, diff --git a/src/components/compositing/platform/common/glfw_windowing.rs b/src/components/compositing/platform/common/glfw_windowing.rs index ca42af1f13f..8fea3535fc9 100644 --- a/src/components/compositing/platform/common/glfw_windowing.rs +++ b/src/components/compositing/platform/common/glfw_windowing.rs @@ -85,22 +85,20 @@ macro_rules! glfw_callback( /// The type of a window. pub struct Window { - pub glfw: glfw::Glfw, - - pub glfw_window: glfw::Window, - pub events: Receiver<(f64, glfw::WindowEvent)>, + glfw: glfw::Glfw, - pub event_queue: RefCell<Vec<WindowEvent>>, + glfw_window: glfw::Window, + events: Receiver<(f64, glfw::WindowEvent)>, - pub drag_origin: Point2D<c_int>, + event_queue: RefCell<Vec<WindowEvent>>, - pub mouse_down_button: Cell<Option<glfw::MouseButton>>, - pub mouse_down_point: Cell<Point2D<c_int>>, + mouse_down_button: Cell<Option<glfw::MouseButton>>, + mouse_down_point: Cell<Point2D<c_int>>, - pub ready_state: Cell<ReadyState>, - pub render_state: Cell<RenderState>, + ready_state: Cell<ReadyState>, + render_state: Cell<RenderState>, - pub last_title_set_time: Cell<Timespec>, + last_title_set_time: Cell<Timespec>, } impl WindowMethods<Application> for Window { @@ -121,8 +119,6 @@ impl WindowMethods<Application> for Window { event_queue: RefCell::new(vec!()), - drag_origin: Point2D(0 as c_int, 0), - mouse_down_button: Cell::new(None), mouse_down_point: Cell::new(Point2D(0 as c_int, 0)), diff --git a/src/components/embedding/embedding.rs b/src/components/embedding/embedding.rs index 601d70d4c57..6d5eb46316f 100644 --- a/src/components/embedding/embedding.rs +++ b/src/components/embedding/embedding.rs @@ -8,7 +8,7 @@ #![feature(globs, macro_rules, phase, thread_local)] #![feature(phase)] -#[phase(syntax, link)] +#[phase(plugin, link)] extern crate log; extern crate rustuv; diff --git a/src/components/embedding/types.rs b/src/components/embedding/types.rs index a4f538a6bba..c01e1ec0cf1 100644 --- a/src/components/embedding/types.rs +++ b/src/components/embedding/types.rs @@ -950,9 +950,10 @@ pub struct cef_scheme_registrar { // per unique |scheme_name| value. If |scheme_name| is already registered or // if an error occurs this function will return false (0). /// - add_custom_scheme: extern "C" fn(registrar: *mut cef_scheme_registrar, - scheme_name: *cef_string_t, - is_standard: c_int, is_local: c_int, is_display_isolated: c_int), + _add_custom_scheme: extern "C" fn(registrar: *mut cef_scheme_registrar, + scheme_name: *cef_string_t, + is_standard: c_int, is_local: c_int, + is_display_isolated: c_int), } /// diff --git a/src/components/gfx/platform/linux/font.rs b/src/components/gfx/platform/linux/font.rs index e61d092ae07..1299315ade2 100644 --- a/src/components/gfx/platform/linux/font.rs +++ b/src/components/gfx/platform/linux/font.rs @@ -37,7 +37,7 @@ fn fixed_to_float_ft(f: i32) -> f64 { } pub struct FontTable { - bogus: () + _bogus: () } impl FontTableMethods for FontTable { diff --git a/src/components/gfx/text/shaping/harfbuzz.rs b/src/components/gfx/text/shaping/harfbuzz.rs index 251ddb8ab36..b6646db771a 100644 --- a/src/components/gfx/text/shaping/harfbuzz.rs +++ b/src/components/gfx/text/shaping/harfbuzz.rs @@ -53,7 +53,6 @@ pub struct ShapedGlyphData { } pub struct ShapedGlyphEntry { - cluster: int, codepoint: GlyphId, advance: Au, offset: Option<Point2D<Au>>, @@ -123,7 +122,6 @@ impl ShapedGlyphData { }; ShapedGlyphEntry { - cluster: (*glyph_info_i).cluster as int, codepoint: (*glyph_info_i).codepoint as GlyphId, advance: x_advance, offset: offset, diff --git a/src/components/layout/block.rs b/src/components/layout/block.rs index 5e0b4a23670..36b525924a7 100644 --- a/src/components/layout/block.rs +++ b/src/components/layout/block.rs @@ -76,7 +76,7 @@ impl FloatedBlockInfo { /// The solutions for the heights-and-margins constraint equation. struct HeightConstraintSolution { top: Au, - bottom: Au, + _bottom: Au, height: Au, margin_top: Au, margin_bottom: Au @@ -87,7 +87,7 @@ impl HeightConstraintSolution { -> HeightConstraintSolution { HeightConstraintSolution { top: top, - bottom: bottom, + _bottom: bottom, height: height, margin_top: margin_top, margin_bottom: margin_bottom, diff --git a/src/components/layout/flow_list.rs b/src/components/layout/flow_list.rs index e136c29282f..19ccb68727e 100644 --- a/src/components/layout/flow_list.rs +++ b/src/components/layout/flow_list.rs @@ -33,15 +33,13 @@ pub struct FlowList { /// Double-ended FlowList iterator pub struct FlowListIterator<'a> { head: &'a Link, - tail: Rawlink, nelem: uint, } /// Double-ended mutable FlowList iterator pub struct MutFlowListIterator<'a> { - list: &'a mut FlowList, + _list: &'a mut FlowList, head: Rawlink, - tail: Rawlink, nelem: uint, } @@ -59,13 +57,6 @@ impl Rawlink { unsafe { mem::transmute(n) } } - fn from_optional_flow_ref(flow_ref: &Option<FlowRef>) -> Rawlink { - match *flow_ref { - None => Rawlink::none(), - Some(ref flow_ref) => Rawlink::some(flow_ref.get()), - } - } - pub unsafe fn resolve_mut(&self) -> Option<&mut Flow> { if self.obj.is_null() { None @@ -204,7 +195,6 @@ impl FlowList { FlowListIterator { nelem: self.len(), head: &self.list_head, - tail: Rawlink::from_optional_flow_ref(&self.list_tail) } } @@ -218,8 +208,7 @@ impl FlowList { MutFlowListIterator { nelem: self.len(), head: head_raw, - tail: Rawlink::from_optional_flow_ref(&self.list_tail), - list: self + _list: self } } } diff --git a/src/components/script/dom/bindings/callback.rs b/src/components/script/dom/bindings/callback.rs index 7a261bf7cc7..8b0c1879dd3 100644 --- a/src/components/script/dom/bindings/callback.rs +++ b/src/components/script/dom/bindings/callback.rs @@ -109,7 +109,7 @@ pub fn WrapCallThisObject<T: Reflectable>(cx: *mut JSContext, pub struct CallSetup { cx: *mut JSContext, - handling: ExceptionHandling + _handling: ExceptionHandling } impl CallSetup { @@ -118,7 +118,7 @@ impl CallSetup { let cx = win.deref().get_cx(); CallSetup { cx: cx, - handling: handling + _handling: handling } } diff --git a/src/components/style/selectors.rs b/src/components/style/selectors.rs index d19d7d9d480..951f85b8e20 100644 --- a/src/components/style/selectors.rs +++ b/src/components/style/selectors.rs @@ -306,13 +306,13 @@ fn parse_one_simple_selector(iter: &mut Iter, namespaces: &NamespaceMap, inside_ -> SimpleSelectorParseResult { match iter.peek() { Some(&IDHash(_)) => match iter.next() { - Some(IDHash(id)) => SimpleSelectorResult(IDSelector(id.into_owned())), + Some(IDHash(id)) => SimpleSelectorResult(IDSelector(id)), _ => fail!("Implementation error, this should not happen."), }, Some(&Delim('.')) => { iter.next(); match iter.next() { - Some(Ident(class)) => SimpleSelectorResult(ClassSelector(class.into_owned())), + Some(Ident(class)) => SimpleSelectorResult(ClassSelector(class)), _ => InvalidSimpleSelector, } } @@ -455,16 +455,16 @@ fn parse_attribute_selector(content: Vec<ComponentValue>, namespaces: &Namespace }};) let result = match iter.next() { None => AttrExists(attr), // [foo] - Some(Delim('=')) => AttrEqual(attr, (get_value!()).into_owned()), // [foo=bar] - Some(IncludeMatch) => AttrIncludes(attr, (get_value!()).into_owned()), // [foo~=bar] + Some(Delim('=')) => AttrEqual(attr, (get_value!())), // [foo=bar] + Some(IncludeMatch) => AttrIncludes(attr, (get_value!())), // [foo~=bar] Some(DashMatch) => { let value = get_value!(); let dashing_value = format!("{}-", value); - AttrDashMatch(attr, value.into_owned(), dashing_value) // [foo|=bar] + AttrDashMatch(attr, value, dashing_value) // [foo|=bar] }, - Some(PrefixMatch) => AttrPrefixMatch(attr, (get_value!()).into_owned()), // [foo^=bar] - Some(SubstringMatch) => AttrSubstringMatch(attr, (get_value!()).into_owned()), // [foo*=bar] - Some(SuffixMatch) => AttrSuffixMatch(attr, (get_value!()).into_owned()), // [foo$=bar] + Some(PrefixMatch) => AttrPrefixMatch(attr, (get_value!())), // [foo^=bar] + Some(SubstringMatch) => AttrSubstringMatch(attr, (get_value!())), // [foo*=bar] + Some(SuffixMatch) => AttrSuffixMatch(attr, (get_value!())), // [foo$=bar] _ => return None }; skip_whitespace(iter); @@ -551,7 +551,7 @@ fn parse_negation(arguments: Vec<ComponentValue>, namespaces: &NamespaceMap) #[inline] fn get_next_ident(iter: &mut Iter) -> String { match iter.next() { - Some(Ident(value)) => value.into_owned(), + Some(Ident(value)) => value, _ => fail!("Implementation error, this should not happen."), } } diff --git a/src/components/style/stylesheets.rs b/src/components/style/stylesheets.rs index cfe1c52a1c4..801fa70d095 100644 --- a/src/components/style/stylesheets.rs +++ b/src/components/style/stylesheets.rs @@ -22,9 +22,6 @@ pub struct Stylesheet { /// List of rules in the order they were found (important for /// cascading order) pub rules: Vec<CSSRule>, - namespaces: NamespaceMap, - encoding: EncodingRef, - base_url: Url, } @@ -120,7 +117,7 @@ impl Stylesheet { } state = next_state; } - Stylesheet{ rules: rules, namespaces: namespaces, encoding: encoding, base_url: base_url } + Stylesheet{ rules: rules } } } diff --git a/src/support/layers/rust-layers b/src/support/layers/rust-layers -Subproject 5ff99f3ac797bd1bed205549d705264fc85d309 +Subproject ccd9bb5564be060efd83f54b6e0918fafb19d1c |