aboutsummaryrefslogtreecommitdiffstats
path: root/components/servo/lib.rs
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2023-06-28 10:07:08 +0200
committerMartin Robinson <mrobinson@igalia.com>2023-07-06 14:49:24 +0200
commitd31cdb682f717d6dbdbd57d60855fd92d822cd66 (patch)
tree6dbb0c6007b545835a119bdf8e78cb5a665afa34 /components/servo/lib.rs
parentf11c6045e33a921f03223c313781586189309bd2 (diff)
downloadservo-d31cdb682f717d6dbdbd57d60855fd92d822cd66.tar.gz
servo-d31cdb682f717d6dbdbd57d60855fd92d822cd66.zip
Make the choice of layout runtime setting
Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>
Diffstat (limited to 'components/servo/lib.rs')
-rw-r--r--components/servo/lib.rs55
1 files changed, 37 insertions, 18 deletions
diff --git a/components/servo/lib.rs b/components/servo/lib.rs
index 25d89187f0c..4b9b37a178b 100644
--- a/components/servo/lib.rs
+++ b/components/servo/lib.rs
@@ -33,7 +33,8 @@ pub use embedder_traits;
pub use euclid;
pub use gfx;
pub use ipc_channel;
-pub use layout_thread;
+pub use layout_thread_2013;
+pub use layout_thread_2020;
pub use media;
pub use msg;
pub use net;
@@ -887,12 +888,23 @@ fn create_constellation(
wgpu_image_map,
};
- let constellation_chan = Constellation::<
- script_layout_interface::message::Msg,
- layout_thread::LayoutThread,
- script::script_thread::ScriptThread,
- script::serviceworker_manager::ServiceWorkerManager,
- >::start(
+ let start_constellation_chan = if opts::get().legacy_layout {
+ Constellation::<
+ script_layout_interface::message::Msg,
+ layout_thread_2013::LayoutThread,
+ script::script_thread::ScriptThread,
+ script::serviceworker_manager::ServiceWorkerManager,
+ >::start
+ } else {
+ Constellation::<
+ script_layout_interface::message::Msg,
+ layout_thread_2020::LayoutThread,
+ script::script_thread::ScriptThread,
+ script::serviceworker_manager::ServiceWorkerManager,
+ >::start
+ };
+
+ start_constellation_chan(
initial_state,
initial_window_size,
opts.random_pipeline_closure_probability,
@@ -902,9 +914,7 @@ fn create_constellation(
!opts.debug.disable_canvas_antialiasing,
canvas_create_sender,
canvas_ipc_sender,
- );
-
- constellation_chan
+ )
}
struct FontCacheWR(CompositorProxy);
@@ -1017,14 +1027,23 @@ pub fn run_content_process(token: String) {
set_logger(content.script_to_constellation_chan().clone());
let background_hang_monitor_register = content.register_with_background_hang_monitor();
-
- content.start_all::<script_layout_interface::message::Msg,
- layout_thread::LayoutThread,
- script::script_thread::ScriptThread>(
- true,
- background_hang_monitor_register,
- None,
- );
+ if opts::get().legacy_layout {
+ content.start_all::<script_layout_interface::message::Msg,
+ layout_thread_2013::LayoutThread,
+ script::script_thread::ScriptThread>(
+ true,
+ background_hang_monitor_register,
+ None,
+ );
+ } else {
+ content.start_all::<script_layout_interface::message::Msg,
+ layout_thread_2020::LayoutThread,
+ script::script_thread::ScriptThread>(
+ true,
+ background_hang_monitor_register,
+ None,
+ );
+ }
},
UnprivilegedContent::ServiceWorker(content) => {
content.start::<ServiceWorkerManager>();