From 1f21d3bd2f5b9d26dbe781f021e619b6157e0b09 Mon Sep 17 00:00:00 2001 From: Martin Robinson Date: Tue, 8 Jul 2014 13:16:30 -0700 Subject: [PATCH] Remove occlusion code from compositor This code tried to prevent buffer requests from parts of layers that were occluded by other layers. This doesn't really make sense when layers can potentially be semi-opaque, and also seems to have not been totally functional. --- src/components/compositing/compositor_data.rs | 29 +------------------ 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/src/components/compositing/compositor_data.rs b/src/components/compositing/compositor_data.rs index 52fc08b9e33..b5ade69b2f2 100644 --- a/src/components/compositing/compositor_data.rs +++ b/src/components/compositing/compositor_data.rs @@ -13,7 +13,7 @@ use geom::rect::Rect; use geom::size::{Size2D, TypedSize2D}; use gfx::render_task::{ReRenderMsg, UnusedBufferMsg}; use layers::layers::{Layer, Flip, LayerBuffer, LayerBufferSet, NoFlip, TextureLayer}; -use layers::quadtree::{Tile, Normal, Hidden}; +use layers::quadtree::Tile; use layers::platform::surface::{NativeCompositingGraphicsContext, NativeSurfaceMethods}; use layers::texturegl::{Texture, TextureTarget}; use servo_msg::compositor_msg::{Epoch, FixedPosition, LayerId}; @@ -208,15 +208,8 @@ impl CompositorData { layer_id) { Some(child_node) => { debug!("compositor_data: node found for set_clipping_rect()"); - let old_rect = child_node.bounds.borrow().clone(); *child_node.bounds.borrow_mut() = new_rect; - // Rect is unhidden - Layer::set_status_page(layer.clone(), old_rect, Normal, false); - - // Hide the new rect - Layer::set_status_page(layer.clone(), new_rect, Hidden, false); - // If possible, unhide child let mut child_data = child_node.extra_data.borrow_mut(); if child_data.hidden && child_data.page_size.is_some() { @@ -246,7 +239,6 @@ impl CompositorData { new_size: Size2D) { debug!("compositor_data: starting resize_helper()"); - debug!("compositor_data: layer found for resize_helper()"); layer.extra_data.borrow_mut().page_size = Some(new_size); let unused_buffers = Layer::resize(layer.clone(), new_size); @@ -262,9 +254,6 @@ impl CompositorData { TypedPoint2D(0f32, 0f32), TypedPoint2D(-1f32, -1f32), size); - layer.extra_data.borrow_mut().hidden = false; - - CompositorData::set_occlusions(layer.clone()); } // Returns whether the layer should be vertically flipped. @@ -405,22 +394,6 @@ impl CompositorData { return true; } - // 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>) { - for kid in layer.children().iter() { - if !kid.extra_data.borrow().hidden { - Layer::set_status_page(layer.clone(), *kid.bounds.borrow(), Hidden, false); - } - } - - for kid in layer.children().iter() { - if !kid.extra_data.borrow().hidden { - CompositorData::set_occlusions(kid.clone()); - } - } - } - /// Destroys all quadtree tiles, sending the buffers back to the renderer to be destroyed or /// reused. fn clear(layer: Rc>) {