diff options
author | Josh Matthews <josh@joshmatthews.net> | 2020-01-15 11:09:37 -0500 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2020-01-15 11:09:37 -0500 |
commit | c385953c97d5f1eb0190487c314274c02904b7f7 (patch) | |
tree | 5f651d733950a07d2ff44a1a5f99f56bc6baabc0 /components/constellation/pipeline.rs | |
parent | 9a518cf7979b79b34611135d09c1dd0a96945255 (diff) | |
download | servo-jdm-revert4.tar.gz servo-jdm-revert4.zip |
Revert "Auto merge of #24677 - jdm:iframe-sizing-cleanup, r=asajeffrey"jdm-revert4
This reverts commit 9a518cf7979b79b34611135d09c1dd0a96945255, reversing
changes made to a33d493a4ff6f8a629a9b82202c49c41ecbefa49.
Diffstat (limited to 'components/constellation/pipeline.rs')
-rw-r--r-- | components/constellation/pipeline.rs | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/components/constellation/pipeline.rs b/components/constellation/pipeline.rs index 3ac5ded15ed..2579343f3fe 100644 --- a/components/constellation/pipeline.rs +++ b/components/constellation/pipeline.rs @@ -12,6 +12,7 @@ use compositing::CompositorProxy; use crossbeam_channel::{unbounded, Sender}; use devtools_traits::{DevtoolsControlMsg, ScriptToDevtoolsControlMsg}; use embedder_traits::EventLoopWaker; +use euclid::{Scale, Size2D}; use gfx::font_cache_thread::FontCacheThread; use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; use ipc_channel::router::ROUTER; @@ -46,6 +47,8 @@ use std::process; use std::rc::Rc; use std::sync::atomic::AtomicBool; use std::sync::Arc; +use style_traits::CSSPixel; +use style_traits::DevicePixel; use webvr_traits::WebVRMsg; /// A `Pipeline` is the constellation's view of a `Document`. Each pipeline has an @@ -162,7 +165,10 @@ pub struct InitialPipelineState { pub mem_profiler_chan: profile_mem::ProfilerChan, /// Information about the initial window size. - pub window_size: WindowSizeData, + pub window_size: Size2D<f32, CSSPixel>, + + /// Information about the device pixel ratio. + pub device_pixel_ratio: Scale<f32, CSSPixel, DevicePixel>, /// The ID of the pipeline namespace for this script thread. pub pipeline_namespace_id: PipelineNamespaceId, @@ -199,6 +205,10 @@ pub struct InitialPipelineState { /// Mechanism to force the compositor to process events. pub event_loop_waker: Option<Box<dyn EventLoopWaker>>, + + /// The ratio of device pixels per px at the default scale. If unspecified, will use the + /// platform default setting. + pub device_pixels_per_px: Option<f32>, } pub struct NewPipeline { @@ -218,6 +228,11 @@ impl Pipeline { // probably requires a general low-memory strategy. let (pipeline_chan, pipeline_port) = ipc::channel().expect("Pipeline main chan"); + let window_size = WindowSizeData { + initial_viewport: state.window_size, + device_pixel_ratio: state.device_pixel_ratio, + }; + let (script_chan, sampler_chan) = match state.event_loop { Some(script_chan) => { let new_layout_info = NewLayoutInfo { @@ -227,7 +242,7 @@ impl Pipeline { top_level_browsing_context_id: state.top_level_browsing_context_id, opener: state.opener, load_data: state.load_data.clone(), - window_size: state.window_size, + window_size: window_size, pipeline_port: pipeline_port, }; @@ -286,7 +301,7 @@ impl Pipeline { resource_threads: state.resource_threads, time_profiler_chan: state.time_profiler_chan, mem_profiler_chan: state.mem_profiler_chan, - window_size: state.window_size, + window_size: window_size, layout_to_constellation_chan: state.layout_to_constellation_chan, script_chan: script_chan.clone(), load_data: state.load_data.clone(), @@ -301,6 +316,7 @@ impl Pipeline { webvr_chan: state.webvr_chan, webxr_registry: state.webxr_registry, player_context: state.player_context, + device_pixels_per_px: state.device_pixels_per_px, }; // Spawn the child process. @@ -507,6 +523,7 @@ pub struct UnprivilegedPipelineContent { webvr_chan: Option<IpcSender<WebVRMsg>>, webxr_registry: webxr_api::Registry, player_context: WindowGLContext, + device_pixels_per_px: Option<f32>, } impl UnprivilegedPipelineContent { @@ -597,7 +614,8 @@ impl UnprivilegedPipelineContent { paint_time_metrics, layout_thread_busy_flag.clone(), self.opts.load_webfonts_synchronously, - self.window_size, + self.opts.initial_window_size, + self.device_pixels_per_px, self.opts.dump_display_list, self.opts.dump_display_list_json, self.opts.dump_style_tree, |