aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/layout_thread.rs
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2016-03-17 14:28:37 -0700
committerPatrick Walton <pcwalton@mimiga.net>2016-03-18 22:11:51 -0700
commit5ea8c342768c9898da82c9b8989a3f8f5dc649d5 (patch)
tree0a9e12d4b4ae6f6afd6fa3b3041b5754568dfddb /components/layout/layout_thread.rs
parent2d6283c64be8c052e6b0a06e857950d7f25db353 (diff)
downloadservo-5ea8c342768c9898da82c9b8989a3f8f5dc649d5.tar.gz
servo-5ea8c342768c9898da82c9b8989a3f8f5dc649d5.zip
layout: Move overflow calculation to be a separate, sequential,
bottom-up pass. Right now, the only reason that overflow calculation works is that we rely on script inducing extra reflows that are sent for display. This was preventing #10021 from landing. This change regresses layout performance by about 1% in my tests. Fixes #7797 properly.
Diffstat (limited to 'components/layout/layout_thread.rs')
-rw-r--r--components/layout/layout_thread.rs19
1 files changed, 14 insertions, 5 deletions
diff --git a/components/layout/layout_thread.rs b/components/layout/layout_thread.rs
index a0afb4d6b91..187655f92b0 100644
--- a/components/layout/layout_thread.rs
+++ b/components/layout/layout_thread.rs
@@ -12,7 +12,7 @@ use app_units::Au;
use azure::azure::AzColor;
use canvas_traits::CanvasMsg;
use construct::ConstructionResult;
-use context::{SharedLayoutContext, heap_size_of_local_context};
+use context::{LayoutContext, SharedLayoutContext, heap_size_of_local_context};
use display_list_builder::ToGfxColor;
use euclid::Matrix4;
use euclid::point::Point2D;
@@ -1336,14 +1336,23 @@ impl LayoutThread {
Some(ref mut parallel) => {
// Parallel mode.
LayoutThread::solve_constraints_parallel(parallel,
- &mut root_flow,
- profiler_metadata,
- self.time_profiler_chan.clone(),
- &*layout_context);
+ &mut root_flow,
+ profiler_metadata,
+ self.time_profiler_chan.clone(),
+ &*layout_context);
}
}
});
+ profile(time::ProfilerCategory::LayoutStoreOverflow,
+ self.profiler_metadata(),
+ self.time_profiler_chan.clone(),
+ || {
+ let layout_context = LayoutContext::new(&*layout_context);
+ sequential::store_overflow(&layout_context,
+ flow_ref::deref_mut(&mut root_flow) as &mut Flow);
+ });
+
self.perform_post_main_layout_passes(data, rw_data, layout_context);
}
}