diff options
author | Ms2ger <Ms2ger@gmail.com> | 2015-11-06 14:58:24 +0100 |
---|---|---|
committer | Ms2ger <Ms2ger@gmail.com> | 2015-11-09 09:03:57 +0100 |
commit | bdfa5fe804137cb90036b71729ca5afa4176230c (patch) | |
tree | 4f5e94d9d7a9792061c89f2621e07da511680562 /components/layout/layout_task.rs | |
parent | 880fb9be0b4c121289be98183bf5dcc10b2d7ea5 (diff) | |
download | servo-bdfa5fe804137cb90036b71729ca5afa4176230c.tar.gz servo-bdfa5fe804137cb90036b71729ca5afa4176230c.zip |
Move generation from LayoutTaskData to LayoutTask.
Diffstat (limited to 'components/layout/layout_task.rs')
-rw-r--r-- | components/layout/layout_task.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs index 5f3c3c9a3c0..977b573c040 100644 --- a/components/layout/layout_task.rs +++ b/components/layout/layout_task.rs @@ -110,10 +110,6 @@ pub struct LayoutTaskData { /// Performs CSS selector matching and style resolution. 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. pub content_box_response: Rect<Au>, @@ -222,6 +218,10 @@ pub struct LayoutTask { /// The workers that we use for parallel operation. 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 /// structures, while still letting the LayoutTask modify them. /// @@ -432,6 +432,7 @@ impl LayoutTask { canvas_layers_receiver: canvas_layers_receiver, canvas_layers_sender: canvas_layers_sender, parallel_traversal: parallel_traversal, + generation: 0, rw_data: Arc::new(Mutex::new( LayoutTaskData { root_flow: None, @@ -439,7 +440,6 @@ impl LayoutTask { viewport_size: Size2D::new(Au(0), Au(0)), stacking_context: None, stylist: stylist, - generation: 0, content_box_response: Rect::zero(), content_boxes_response: Vec::new(), client_rect_response: Rect::zero(), @@ -485,7 +485,7 @@ impl LayoutTask { stylist: StylistWrapper(&*rw_data.stylist), url: (*url).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()), goal: goal, running_animations: rw_data.running_animations.clone(), @@ -1410,7 +1410,7 @@ impl LayoutTask { root_flow.dump(); } - rw_data.generation += 1; + self.generation += 1; } } |