mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Remove CompositorData::add_child
The contents of this method have dwindled to two statements. Just remove the method now.
This commit is contained in:
parent
d3c0d8d6f8
commit
9edaff4304
2 changed files with 13 additions and 17 deletions
|
@ -2,7 +2,7 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use compositor_data::{CompositorData, WantsScrollEvents};
|
use compositor_data::{CompositorData, DoesntWantScrollEvents, WantsScrollEvents};
|
||||||
use compositor_task::{Msg, CompositorTask, Exit, ChangeReadyState, SetIds, LayerProperties};
|
use compositor_task::{Msg, CompositorTask, Exit, ChangeReadyState, SetIds, LayerProperties};
|
||||||
use compositor_task::{GetGraphicsMetadata, CreateOrUpdateRootLayer, CreateOrUpdateDescendantLayer};
|
use compositor_task::{GetGraphicsMetadata, CreateOrUpdateRootLayer, CreateOrUpdateDescendantLayer};
|
||||||
use compositor_task::{SetLayerClipRect, Paint, ScrollFragmentPoint, LoadComplete};
|
use compositor_task::{SetLayerClipRect, Paint, ScrollFragmentPoint, LoadComplete};
|
||||||
|
@ -421,12 +421,15 @@ impl IOCompositor {
|
||||||
background_color: layer_properties.background_color,
|
background_color: layer_properties.background_color,
|
||||||
scroll_policy: FixedPosition,
|
scroll_policy: FixedPosition,
|
||||||
};
|
};
|
||||||
let new_root = CompositorData::new_layer(root_pipeline,
|
let new_root = CompositorData::new_layer(root_pipeline.clone(),
|
||||||
root_properties,
|
root_properties,
|
||||||
WantsScrollEvents,
|
WantsScrollEvents,
|
||||||
self.opts.tile_size);
|
self.opts.tile_size);
|
||||||
|
let first_chid = CompositorData::new_layer(root_pipeline.clone(),
|
||||||
CompositorData::add_child(new_root.clone(), layer_properties);
|
layer_properties,
|
||||||
|
DoesntWantScrollEvents,
|
||||||
|
self.opts.tile_size);
|
||||||
|
new_root.add_child(first_chid);
|
||||||
|
|
||||||
// Release all tiles from the layer before dropping it.
|
// Release all tiles from the layer before dropping it.
|
||||||
match self.scene.root {
|
match self.scene.root {
|
||||||
|
@ -459,7 +462,12 @@ impl IOCompositor {
|
||||||
layer_properties.pipeline_id,
|
layer_properties.pipeline_id,
|
||||||
parent_layer_id) {
|
parent_layer_id) {
|
||||||
Some(ref mut parent_layer) => {
|
Some(ref mut parent_layer) => {
|
||||||
CompositorData::add_child(parent_layer.clone(), layer_properties);
|
let pipeline = parent_layer.extra_data.borrow().pipeline.clone();
|
||||||
|
let new_layer = CompositorData::new_layer(pipeline,
|
||||||
|
layer_properties,
|
||||||
|
DoesntWantScrollEvents,
|
||||||
|
parent_layer.tile_size);
|
||||||
|
parent_layer.add_child(new_layer);
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
fail!("Compositor: couldn't find parent layer");
|
fail!("Compositor: couldn't find parent layer");
|
||||||
|
|
|
@ -68,18 +68,6 @@ impl CompositorData {
|
||||||
Rc::new(Layer::new(layer_properties.rect, tile_size, new_compositor_data))
|
Rc::new(Layer::new(layer_properties.rect, tile_size, new_compositor_data))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Adds a child layer to the layer with the given ID and the given pipeline, if it doesn't
|
|
||||||
/// exist yet. The child layer will have the same pipeline, tile size, memory limit, and CPU
|
|
||||||
/// painting status as its parent.
|
|
||||||
pub fn add_child(layer: Rc<Layer<CompositorData>>,
|
|
||||||
layer_properties: LayerProperties) {
|
|
||||||
let new_kid = CompositorData::new_layer(layer.extra_data.borrow().pipeline.clone(),
|
|
||||||
layer_properties,
|
|
||||||
DoesntWantScrollEvents,
|
|
||||||
layer.tile_size);
|
|
||||||
layer.add_child(new_kid.clone());
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn update_layer(layer: Rc<Layer<CompositorData>>, layer_properties: LayerProperties) {
|
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().epoch = layer_properties.epoch;
|
||||||
layer.extra_data.borrow_mut().background_color = layer_properties.background_color;
|
layer.extra_data.borrow_mut().background_color = layer_properties.background_color;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue