aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/layout_task.rs
diff options
context:
space:
mode:
authorMs2ger <Ms2ger@gmail.com>2015-11-06 17:35:39 +0100
committerMs2ger <Ms2ger@gmail.com>2015-11-09 09:04:02 +0100
commitee2b77e8f5bb1a87c97ac639bc99fbdf8c223243 (patch)
treea711a975524a9a53328f99ed732d4131e5171f26 /components/layout/layout_task.rs
parente8f31f2ed7cf4be5ac578ce83851e2f7b3ef1c23 (diff)
downloadservo-ee2b77e8f5bb1a87c97ac639bc99fbdf8c223243.tar.gz
servo-ee2b77e8f5bb1a87c97ac639bc99fbdf8c223243.zip
Move visible_rects from LayoutTaskData to LayoutTask.
Diffstat (limited to 'components/layout/layout_task.rs')
-rw-r--r--components/layout/layout_task.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs
index 2a189e49ce2..ee4008ede39 100644
--- a/components/layout/layout_task.rs
+++ b/components/layout/layout_task.rs
@@ -127,10 +127,6 @@ pub struct LayoutTaskData {
/// A counter for epoch messages
epoch: Epoch,
-
- /// The position and size of the visible rect for each layer. We do not build display lists
- /// for any areas more than `DISPLAY_PORT_SIZE_FACTOR` screens away from this area.
- pub visible_rects: Arc<HashMap<LayerId, Rect<Au>, DefaultState<FnvHasher>>>,
}
/// Information needed by the layout task.
@@ -214,6 +210,10 @@ pub struct LayoutTask {
/// The root of the flow tree.
root_flow: Option<FlowRef>,
+ /// The position and size of the visible rect for each layer. We do not build display lists
+ /// for any areas more than `DISPLAY_PORT_SIZE_FACTOR` screens away from this area.
+ visible_rects: Arc<HashMap<LayerId, Rect<Au>, DefaultState<FnvHasher>>>,
+
/// A mutex to allow for fast, read-only RPC of layout's internal data
/// structures, while still letting the LayoutTask modify them.
///
@@ -429,6 +429,7 @@ impl LayoutTask {
new_animations_receiver: new_animations_receiver,
outstanding_web_fonts: outstanding_web_fonts_counter,
root_flow: None,
+ visible_rects: Arc::new(HashMap::with_hash_state(Default::default())),
rw_data: Arc::new(Mutex::new(
LayoutTaskData {
constellation_chan: constellation_chan,
@@ -441,7 +442,6 @@ impl LayoutTask {
resolved_style_response: None,
running_animations: Arc::new(HashMap::new()),
offset_parent_response: OffsetParentResponse::empty(),
- visible_rects: Arc::new(HashMap::with_hash_state(Default::default())),
epoch: Epoch(0),
})),
}
@@ -476,7 +476,7 @@ impl LayoutTask {
canvas_layers_sender: Mutex::new(self.canvas_layers_sender.clone()),
stylist: StylistWrapper(&*rw_data.stylist),
url: (*url).clone(),
- visible_rects: rw_data.visible_rects.clone(),
+ visible_rects: self.visible_rects.clone(),
generation: self.generation,
new_animations_sender: Mutex::new(self.new_animations_sender.clone()),
goal: goal,
@@ -1228,7 +1228,7 @@ impl LayoutTask {
Size2D::new(rw_data.viewport_size.width * DISPLAY_PORT_THRESHOLD_SIZE_FACTOR,
rw_data.viewport_size.height * DISPLAY_PORT_THRESHOLD_SIZE_FACTOR);
for &(ref layer_id, ref new_visible_rect) in &new_visible_rects {
- match rw_data.visible_rects.get(layer_id) {
+ match self.visible_rects.get(layer_id) {
None => {
old_visible_rects.insert(*layer_id, *new_visible_rect);
}
@@ -1245,7 +1245,7 @@ impl LayoutTask {
if !must_regenerate_display_lists {
// Update `visible_rects` in case there are new layers that were discovered.
- rw_data.visible_rects = Arc::new(old_visible_rects);
+ self.visible_rects = Arc::new(old_visible_rects);
return true
}
@@ -1253,7 +1253,7 @@ impl LayoutTask {
for &(ref layer_id, ref new_visible_rect) in &new_visible_rects {
old_visible_rects.insert(*layer_id, *new_visible_rect);
}
- rw_data.visible_rects = Arc::new(old_visible_rects);
+ self.visible_rects = Arc::new(old_visible_rects);
// Regenerate the display lists.
let reflow_info = Reflow {