diff options
-rw-r--r-- | Cargo.lock | 39 | ||||
-rw-r--r-- | components/layout/Cargo.toml | 2 | ||||
-rw-r--r-- | components/layout_2020/Cargo.toml | 15 | ||||
-rw-r--r-- | components/layout_2020/lib.rs | 3 | ||||
-rw-r--r-- | components/layout_thread/Cargo.toml | 4 | ||||
-rw-r--r-- | components/layout_thread_2020/Cargo.toml | 28 | ||||
-rw-r--r-- | components/layout_thread_2020/lib.rs | 59 | ||||
-rw-r--r-- | components/servo/Cargo.toml | 5 | ||||
-rw-r--r-- | components/servo/build.rs | 20 | ||||
-rw-r--r-- | components/style/Cargo.toml | 1 | ||||
-rw-r--r-- | etc/taskcluster/decision_task.py | 1 | ||||
-rw-r--r-- | ports/glutin/Cargo.toml | 2 | ||||
-rw-r--r-- | ports/libmlservo/Cargo.toml | 2 | ||||
-rw-r--r-- | ports/libsimpleservo/api/Cargo.toml | 2 | ||||
-rw-r--r-- | ports/libsimpleservo/capi/Cargo.toml | 2 | ||||
-rw-r--r-- | ports/libsimpleservo/jniapi/Cargo.toml | 2 | ||||
-rw-r--r-- | python/servo/command_base.py | 7 | ||||
-rw-r--r-- | python/servo/testing_commands.py | 2 | ||||
-rw-r--r-- | tests/unit/metrics/Cargo.toml | 2 |
19 files changed, 186 insertions, 12 deletions
diff --git a/Cargo.lock b/Cargo.lock index 181afad5ac1..51dbf819506 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2312,7 +2312,7 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "layout" +name = "layout_2013" version = "0.0.1" dependencies = [ "app_units 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2360,7 +2360,14 @@ dependencies = [ ] [[package]] -name = "layout_thread" +name = "layout_2020" +version = "0.0.1" +dependencies = [ + "style 0.0.1", +] + +[[package]] +name = "layout_thread_2013" version = "0.0.1" dependencies = [ "app_units 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2375,7 +2382,7 @@ dependencies = [ "histogram 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", "html5ever 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", - "layout 0.0.1", + "layout_2013 0.0.1", "layout_traits 0.0.1", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.53 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2406,6 +2413,27 @@ dependencies = [ ] [[package]] +name = "layout_thread_2020" +version = "0.0.1" +dependencies = [ + "crossbeam-channel 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.19.8 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx 0.0.1", + "ipc-channel 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", + "layout_2020 0.0.1", + "layout_traits 0.0.1", + "metrics 0.0.1", + "msg 0.0.1", + "net_traits 0.0.1", + "profile_traits 0.0.1", + "script_layout_interface 0.0.1", + "script_traits 0.0.1", + "servo_geometry 0.0.1", + "servo_url 0.0.1", + "webrender_api 0.60.0 (git+https://github.com/jdm/webrender?branch=servo-hl)", +] + +[[package]] name = "layout_traits" version = "0.0.1" dependencies = [ @@ -2514,7 +2542,8 @@ dependencies = [ "gleam 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", "keyboard-types 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "layout_thread 0.0.1", + "layout_thread_2013 0.0.1", + "layout_thread_2020 0.0.1", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "mozangle 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", @@ -2759,7 +2788,7 @@ version = "0.0.1" dependencies = [ "gfx_traits 0.0.1", "ipc-channel 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", - "layout 0.0.1", + "layout_2013 0.0.1", "metrics 0.0.1", "msg 0.0.1", "profile_traits 0.0.1", diff --git a/components/layout/Cargo.toml b/components/layout/Cargo.toml index 91b29ff2ee2..a6623516129 100644 --- a/components/layout/Cargo.toml +++ b/components/layout/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "layout" +name = "layout_2013" version = "0.0.1" authors = ["The Servo Project Developers"] license = "MPL-2.0" diff --git a/components/layout_2020/Cargo.toml b/components/layout_2020/Cargo.toml new file mode 100644 index 00000000000..bff14135888 --- /dev/null +++ b/components/layout_2020/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "layout_2020" +version = "0.0.1" +authors = ["The Servo Project Developers"] +license = "MPL-2.0" +edition = "2018" +publish = false + +[lib] +path = "lib.rs" +test = false +doctest = false + +[dependencies] +style = {path = "../style", features = ["servo", "servo-layout-2020"]} diff --git a/components/layout_2020/lib.rs b/components/layout_2020/lib.rs new file mode 100644 index 00000000000..daa3e8897c2 --- /dev/null +++ b/components/layout_2020/lib.rs @@ -0,0 +1,3 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ diff --git a/components/layout_thread/Cargo.toml b/components/layout_thread/Cargo.toml index 9ae8a6f953d..e0e91c0d449 100644 --- a/components/layout_thread/Cargo.toml +++ b/components/layout_thread/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "layout_thread" +name = "layout_thread_2013" version = "0.0.1" authors = ["The Servo Project Developers"] license = "MPL-2.0" @@ -23,7 +23,7 @@ gfx_traits = {path = "../gfx_traits"} histogram = "0.6.8" html5ever = "0.23" ipc-channel = "0.11" -layout = {path = "../layout"} +layout = {path = "../layout", package = "layout_2013"} layout_traits = {path = "../layout_traits"} lazy_static = "1" libc = "0.2" diff --git a/components/layout_thread_2020/Cargo.toml b/components/layout_thread_2020/Cargo.toml new file mode 100644 index 00000000000..157d1085711 --- /dev/null +++ b/components/layout_thread_2020/Cargo.toml @@ -0,0 +1,28 @@ +[package] +name = "layout_thread_2020" +version = "0.0.1" +authors = ["The Servo Project Developers"] +license = "MPL-2.0" +edition = "2018" +publish = false + +[lib] +name = "layout_thread" +path = "lib.rs" + +[dependencies] +crossbeam-channel = "0.3" +euclid = "0.19" +gfx = {path = "../gfx"} +ipc-channel = "0.11" +layout = {path = "../layout_2020", package = "layout_2020"} +layout_traits = {path = "../layout_traits"} +metrics = {path = "../metrics"} +msg = {path = "../msg"} +net_traits = {path = "../net_traits"} +profile_traits = {path = "../profile_traits"} +script_layout_interface = {path = "../script_layout_interface"} +script_traits = {path = "../script_traits"} +servo_url = {path = "../url"} +servo_geometry = {path = "../geometry"} +webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]} diff --git a/components/layout_thread_2020/lib.rs b/components/layout_thread_2020/lib.rs new file mode 100644 index 00000000000..d101ccac107 --- /dev/null +++ b/components/layout_thread_2020/lib.rs @@ -0,0 +1,59 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +use crossbeam_channel::{Receiver, Sender}; +use euclid::TypedSize2D; +use gfx::font_cache_thread::FontCacheThread; +use ipc_channel::ipc::{IpcReceiver, IpcSender}; +use metrics::PaintTimeMetrics; +use msg::constellation_msg::TopLevelBrowsingContextId; +use msg::constellation_msg::{BackgroundHangMonitorRegister, PipelineId}; +use net_traits::image_cache::ImageCache; +use profile_traits::{mem, time}; +use script_traits::LayoutMsg as ConstellationMsg; +use script_traits::{ConstellationControlMsg, LayoutControlMsg}; +use servo_geometry::DeviceIndependentPixel; +use servo_url::ServoUrl; +use std::sync::atomic::AtomicBool; +use std::sync::Arc; + +pub struct LayoutThread; + +impl layout_traits::LayoutThreadFactory for LayoutThread { + type Message = script_layout_interface::message::Msg; + + #[allow(unused)] + fn create( + id: PipelineId, + top_level_browsing_context_id: TopLevelBrowsingContextId, + url: ServoUrl, + is_iframe: bool, + chan: (Sender<Self::Message>, Receiver<Self::Message>), + pipeline_port: IpcReceiver<LayoutControlMsg>, + background_hang_monitor: Box<dyn BackgroundHangMonitorRegister>, + constellation_chan: IpcSender<ConstellationMsg>, + script_chan: IpcSender<ConstellationControlMsg>, + image_cache: Arc<dyn ImageCache>, + font_cache_thread: FontCacheThread, + time_profiler_chan: time::ProfilerChan, + mem_profiler_chan: mem::ProfilerChan, + content_process_shutdown_chan: Option<IpcSender<()>>, + webrender_api_sender: webrender_api::RenderApiSender, + webrender_document: webrender_api::DocumentId, + paint_time_metrics: PaintTimeMetrics, + busy: Arc<AtomicBool>, + load_webfonts_synchronously: bool, + initial_window_size: TypedSize2D<u32, DeviceIndependentPixel>, + device_pixels_per_px: Option<f32>, + dump_display_list: bool, + dump_display_list_json: bool, + dump_style_tree: bool, + dump_rule_tree: bool, + relayout_event: bool, + nonincremental_layout: bool, + trace_layout: bool, + dump_flow_tree: bool, + ) { + } +} diff --git a/components/servo/Cargo.toml b/components/servo/Cargo.toml index d64ab06149a..b717adce9e4 100644 --- a/components/servo/Cargo.toml +++ b/components/servo/Cargo.toml @@ -20,6 +20,8 @@ energy-profiling = ["profile_traits/energy-profiling"] profilemozjs = ["script/profilemozjs"] googlevr = ["webvr/googlevr"] js_backtrace = ["script/js_backtrace"] +layout-2013 = ["layout_thread_2013"] +layout-2020 = ["layout_thread_2020"] max_log_level = ["log/release_max_level_info"] native-bluetooth = ["bluetooth/native-bluetooth"] no_wgl = ["canvas/no_wgl"] @@ -53,7 +55,8 @@ gfx = {path = "../gfx"} gleam = "0.6" ipc-channel = "0.11" keyboard-types = "0.4" -layout_thread = {path = "../layout_thread"} +layout_thread_2013 = {path = "../layout_thread", optional = true} +layout_thread_2020 = {path = "../layout_thread_2020", optional = true} log = "0.4" msg = {path = "../msg"} net = {path = "../net"} diff --git a/components/servo/build.rs b/components/servo/build.rs new file mode 100644 index 00000000000..67482840dac --- /dev/null +++ b/components/servo/build.rs @@ -0,0 +1,20 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +fn main() { + let layout_2013 = std::env::var_os("CARGO_FEATURE_LAYOUT_2013").is_some(); + let layout_2020 = std::env::var_os("CARGO_FEATURE_LAYOUT_2020").is_some(); + + if !(layout_2013 || layout_2020) { + error("Must enable one of the `layout-2013` or `layout-2020` features.") + } + if layout_2013 && layout_2020 { + error("Must not enable both of the `layout-2013` or `layout-2020` features.") + } +} + +fn error(message: &str) { + print!("\n\n Error: {}\n\n", message); + std::process::exit(1) +} diff --git a/components/style/Cargo.toml b/components/style/Cargo.toml index 05798b83bcb..c0c01204037 100644 --- a/components/style/Cargo.toml +++ b/components/style/Cargo.toml @@ -21,6 +21,7 @@ use_bindgen = ["bindgen", "regex", "toml"] servo = ["serde", "style_traits/servo", "servo_atoms", "servo_config", "html5ever", "cssparser/serde", "encoding_rs", "malloc_size_of/servo", "arrayvec/use_union", "servo_url", "string_cache", "crossbeam-channel", "to_shmem/servo", "servo_arc/servo"] +"servo-layout-2020" = [] gecko_debug = [] gecko_refcount_logging = [] gecko_profiler = [] diff --git a/etc/taskcluster/decision_task.py b/etc/taskcluster/decision_task.py index cafbe75c78a..90e57bc7ca9 100644 --- a/etc/taskcluster/decision_task.py +++ b/etc/taskcluster/decision_task.py @@ -186,6 +186,7 @@ def linux_tidy_unit_docs(): ./mach test-unit ./mach package --dev ./mach build --dev --features canvas2d-raqote + ./mach build --dev --features layout-2020 ./mach build --dev --libsimpleservo ./mach test-tidy --no-progress --self-test diff --git a/ports/glutin/Cargo.toml b/ports/glutin/Cargo.toml index 37feefddead..c52a04d0b84 100644 --- a/ports/glutin/Cargo.toml +++ b/ports/glutin/Cargo.toml @@ -34,6 +34,8 @@ egl = ["libservo/egl"] energy-profiling = ["libservo/energy-profiling"] debugmozjs = ["libservo/debugmozjs"] js_backtrace = ["libservo/js_backtrace"] +layout-2013 = ["libservo/layout-2013"] +layout-2020 = ["libservo/layout-2020"] max_log_level = ["log/release_max_level_info"] native-bluetooth = ["libservo/native-bluetooth"] profilemozjs = ["libservo/profilemozjs"] diff --git a/ports/libmlservo/Cargo.toml b/ports/libmlservo/Cargo.toml index 9942d95baac..e4c67e9be2b 100644 --- a/ports/libmlservo/Cargo.toml +++ b/ports/libmlservo/Cargo.toml @@ -16,6 +16,8 @@ bench = false canvas2d-azure = ["simpleservo/canvas2d-azure"] canvas2d-raqote = ["simpleservo/canvas2d-raqote"] egl = ["simpleservo/egl"] +layout-2013 = ["simpleservo/layout-2013"] +layout-2020 = ["simpleservo/layout-2020"] [dependencies] libservo = { path = "../../components/servo", features = ["no_static_freetype"] } diff --git a/ports/libsimpleservo/api/Cargo.toml b/ports/libsimpleservo/api/Cargo.toml index 6dd0c7c014a..8efa8d6086a 100644 --- a/ports/libsimpleservo/api/Cargo.toml +++ b/ports/libsimpleservo/api/Cargo.toml @@ -34,6 +34,8 @@ egl = ["libservo/egl"] energy-profiling = ["libservo/energy-profiling"] googlevr = ["libservo/googlevr"] js_backtrace = ["libservo/js_backtrace"] +layout-2013 = ["libservo/layout-2013"] +layout-2020 = ["libservo/layout-2020"] max_log_level = ["log/release_max_level_info"] native-bluetooth = ["libservo/native-bluetooth"] no_static_freetype = ["libservo/no_static_freetype"] diff --git a/ports/libsimpleservo/capi/Cargo.toml b/ports/libsimpleservo/capi/Cargo.toml index 8c6707a02aa..7d508495022 100644 --- a/ports/libsimpleservo/capi/Cargo.toml +++ b/ports/libsimpleservo/capi/Cargo.toml @@ -29,6 +29,8 @@ egl = ["simpleservo/egl"] energy-profiling = ["simpleservo/energy-profiling"] googlevr = ["simpleservo/googlevr"] js_backtrace = ["simpleservo/js_backtrace"] +layout-2013 = ["simpleservo/layout-2013"] +layout-2020 = ["simpleservo/layout-2020"] max_log_level = ["simpleservo/max_log_level"] native-bluetooth = ["simpleservo/native-bluetooth"] no_wgl = ["simpleservo/no_wgl"] diff --git a/ports/libsimpleservo/jniapi/Cargo.toml b/ports/libsimpleservo/jniapi/Cargo.toml index 5f5098a4c4f..391d64416c9 100644 --- a/ports/libsimpleservo/jniapi/Cargo.toml +++ b/ports/libsimpleservo/jniapi/Cargo.toml @@ -34,6 +34,8 @@ egl = ["simpleservo/egl"] energy-profiling = ["simpleservo/energy-profiling"] googlevr = ["simpleservo/googlevr"] js_backtrace = ["simpleservo/js_backtrace"] +layout-2013 = ["simpleservo/layout-2013"] +layout-2020 = ["simpleservo/layout-2020"] max_log_level = ["simpleservo/max_log_level"] native-bluetooth = ["simpleservo/native-bluetooth"] oculusvr = ["simpleservo/oculusvr"] diff --git a/python/servo/command_base.py b/python/servo/command_base.py index 265d2814eb6..46f9f6e5ad3 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -788,6 +788,7 @@ install them, let us know by filing a bug!") action='store_true', help='Build for HoloLens (x64)'), CommandArgument('--with-raqote', default=None, action='store_true'), + CommandArgument('--with-layout-2020', default=None, action='store_true'), CommandArgument('--without-wgl', default=None, action='store_true'), ] @@ -813,7 +814,7 @@ install them, let us know by filing a bug!") env=None, verbose=False, target=None, android=False, magicleap=False, libsimpleservo=False, features=None, debug_mozjs=False, with_debug_assertions=False, - with_frame_pointer=False, with_raqote=False, without_wgl=False, + with_frame_pointer=False, with_raqote=False, with_layout_2020=False, without_wgl=False, uwp=False, ): env = env or self.build_env() @@ -852,6 +853,10 @@ install them, let us know by filing a bug!") features.append("canvas2d-raqote") elif "canvas2d-raqote" not in features: features.append("canvas2d-azure") + if with_layout_2020 and "layout-2013" not in features: + features.append("layout-2020") + elif "layout-2020" not in features: + features.append("layout-2013") if with_frame_pointer: env['RUSTFLAGS'] = env.get('RUSTFLAGS', "") + " -C force-frame-pointers=yes" features.append("profilemozjs") diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py index d1880f6385e..57676377a7c 100644 --- a/python/servo/testing_commands.py +++ b/python/servo/testing_commands.py @@ -248,7 +248,7 @@ class MachCommands(CommandBase): self_contained_tests = [ "background_hang_monitor", "gfx", - "layout", + "layout_2013", "msg", "net", "net_traits", diff --git a/tests/unit/metrics/Cargo.toml b/tests/unit/metrics/Cargo.toml index 23db807945d..b268e12e909 100644 --- a/tests/unit/metrics/Cargo.toml +++ b/tests/unit/metrics/Cargo.toml @@ -13,7 +13,7 @@ doctest = false [dependencies] gfx_traits = {path = "../../../components/gfx_traits"} ipc-channel = "0.11" -layout = {path = "../../../components/layout"} +layout = {path = "../../../components/layout", package = "layout_2013"} metrics = {path = "../../../components/metrics"} msg = {path = "../../../components/msg"} profile_traits = {path = "../../../components/profile_traits"} |