mirror of
https://github.com/servo/servo.git
synced 2025-06-25 09:34:32 +01:00
Move generation from LayoutTaskData to LayoutTask.
This commit is contained in:
parent
880fb9be0b
commit
bdfa5fe804
1 changed files with 7 additions and 7 deletions
|
@ -110,10 +110,6 @@ pub struct LayoutTaskData {
|
||||||
/// Performs CSS selector matching and style resolution.
|
/// Performs CSS selector matching and style resolution.
|
||||||
pub stylist: Box<Stylist>,
|
pub stylist: Box<Stylist>,
|
||||||
|
|
||||||
/// Starts at zero, and increased by one every time a layout completes.
|
|
||||||
/// This can be used to easily check for invalid stale data.
|
|
||||||
pub generation: u32,
|
|
||||||
|
|
||||||
/// A queued response for the union of the content boxes of a node.
|
/// A queued response for the union of the content boxes of a node.
|
||||||
pub content_box_response: Rect<Au>,
|
pub content_box_response: Rect<Au>,
|
||||||
|
|
||||||
|
@ -222,6 +218,10 @@ pub struct LayoutTask {
|
||||||
/// The workers that we use for parallel operation.
|
/// The workers that we use for parallel operation.
|
||||||
parallel_traversal: Option<WorkQueue<SharedLayoutContext, WorkQueueData>>,
|
parallel_traversal: Option<WorkQueue<SharedLayoutContext, WorkQueueData>>,
|
||||||
|
|
||||||
|
/// Starts at zero, and increased by one every time a layout completes.
|
||||||
|
/// This can be used to easily check for invalid stale data.
|
||||||
|
generation: u32,
|
||||||
|
|
||||||
/// A mutex to allow for fast, read-only RPC of layout's internal data
|
/// A mutex to allow for fast, read-only RPC of layout's internal data
|
||||||
/// structures, while still letting the LayoutTask modify them.
|
/// structures, while still letting the LayoutTask modify them.
|
||||||
///
|
///
|
||||||
|
@ -432,6 +432,7 @@ impl LayoutTask {
|
||||||
canvas_layers_receiver: canvas_layers_receiver,
|
canvas_layers_receiver: canvas_layers_receiver,
|
||||||
canvas_layers_sender: canvas_layers_sender,
|
canvas_layers_sender: canvas_layers_sender,
|
||||||
parallel_traversal: parallel_traversal,
|
parallel_traversal: parallel_traversal,
|
||||||
|
generation: 0,
|
||||||
rw_data: Arc::new(Mutex::new(
|
rw_data: Arc::new(Mutex::new(
|
||||||
LayoutTaskData {
|
LayoutTaskData {
|
||||||
root_flow: None,
|
root_flow: None,
|
||||||
|
@ -439,7 +440,6 @@ impl LayoutTask {
|
||||||
viewport_size: Size2D::new(Au(0), Au(0)),
|
viewport_size: Size2D::new(Au(0), Au(0)),
|
||||||
stacking_context: None,
|
stacking_context: None,
|
||||||
stylist: stylist,
|
stylist: stylist,
|
||||||
generation: 0,
|
|
||||||
content_box_response: Rect::zero(),
|
content_box_response: Rect::zero(),
|
||||||
content_boxes_response: Vec::new(),
|
content_boxes_response: Vec::new(),
|
||||||
client_rect_response: Rect::zero(),
|
client_rect_response: Rect::zero(),
|
||||||
|
@ -485,7 +485,7 @@ impl LayoutTask {
|
||||||
stylist: StylistWrapper(&*rw_data.stylist),
|
stylist: StylistWrapper(&*rw_data.stylist),
|
||||||
url: (*url).clone(),
|
url: (*url).clone(),
|
||||||
visible_rects: rw_data.visible_rects.clone(),
|
visible_rects: rw_data.visible_rects.clone(),
|
||||||
generation: rw_data.generation,
|
generation: self.generation,
|
||||||
new_animations_sender: Mutex::new(rw_data.new_animations_sender.clone()),
|
new_animations_sender: Mutex::new(rw_data.new_animations_sender.clone()),
|
||||||
goal: goal,
|
goal: goal,
|
||||||
running_animations: rw_data.running_animations.clone(),
|
running_animations: rw_data.running_animations.clone(),
|
||||||
|
@ -1410,7 +1410,7 @@ impl LayoutTask {
|
||||||
root_flow.dump();
|
root_flow.dump();
|
||||||
}
|
}
|
||||||
|
|
||||||
rw_data.generation += 1;
|
self.generation += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue