aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/components/compositing/compositor.rs26
-rw-r--r--src/components/compositing/compositor_data.rs41
2 files changed, 15 insertions, 52 deletions
diff --git a/src/components/compositing/compositor.rs b/src/components/compositing/compositor.rs
index 2ce5199cb08..eec1b90936d 100644
--- a/src/components/compositing/compositor.rs
+++ b/src/components/compositing/compositor.rs
@@ -465,20 +465,24 @@ impl IOCompositor {
pipeline_id: PipelineId,
layer_id: LayerId,
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));
- true
- }
- None => {
- false
+ let should_ask_for_tiles = match self.scene.root {
+ Some(ref root_layer) => {
+ match CompositorData::find_layer_with_pipeline_and_layer_id(root_layer.clone(),
+ pipeline_id,
+ layer_id) {
+ Some(ref layer) => {
+ *layer.bounds.borrow_mut() = new_rect;
+ true
+ }
+ None => {
+ fail!("compositor received SetLayerClipRect for nonexistent layer");
+ }
+ }
}
+ None => false
};
- if ask {
+ if should_ask_for_tiles {
self.ask_for_tiles();
}
}
diff --git a/src/components/compositing/compositor_data.rs b/src/components/compositing/compositor_data.rs
index 0efc3585377..1432b1dd3d6 100644
--- a/src/components/compositing/compositor_data.rs
+++ b/src/components/compositing/compositor_data.rs
@@ -138,34 +138,6 @@ impl CompositorData {
layer.children().iter().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.
- // This method returns false if the specified layer is not found.
- pub fn set_clipping_rect(layer: Rc<Layer<CompositorData>>,
- pipeline_id: PipelineId,
- layer_id: LayerId,
- new_rect: Rect<f32>)
- -> bool {
- debug!("compositor_data: starting set_clipping_rect()");
- match CompositorData::find_child_with_pipeline_and_layer_id(layer.clone(),
- pipeline_id,
- layer_id) {
- Some(child_node) => {
- debug!("compositor_data: node found for set_clipping_rect()");
- *child_node.bounds.borrow_mut() = new_rect;
- true
- }
- None => {
- layer.children().iter()
- .any(|kid| CompositorData::set_clipping_rect(kid.clone(),
- pipeline_id,
- layer_id,
- new_rect))
-
- }
- }
- }
-
pub fn update_layer(layer: Rc<Layer<CompositorData>>, layer_properties: LayerProperties) {
layer.extra_data.borrow_mut().epoch = layer_properties.epoch;
layer.extra_data.borrow_mut().background_color = layer_properties.background_color;
@@ -182,19 +154,6 @@ impl CompositorData {
size);
}
- fn find_child_with_pipeline_and_layer_id(layer: Rc<Layer<CompositorData>>,
- pipeline_id: PipelineId,
- layer_id: LayerId)
- -> 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.clone());
- }
- }
- return None
- }
-
pub fn find_layer_with_pipeline_and_layer_id(layer: Rc<Layer<CompositorData>>,
pipeline_id: PipelineId,
layer_id: LayerId)