aboutsummaryrefslogtreecommitdiffstats
path: root/components/constellation
diff options
context:
space:
mode:
authorglowe <graham@spinlag.com>2019-10-26 11:37:09 -0400
committerglowe <graham@spinlag.com>2019-10-26 12:00:14 -0400
commit0ee300479ec22e18ea00d9d1c7c60bdd35808983 (patch)
treec890e2ec71ef232abcdc5e2697c0676663aa0e73 /components/constellation
parent74f1e2ec322b22ef9a1370d56d7cf3b1d38479ef (diff)
downloadservo-0ee300479ec22e18ea00d9d1c7c60bdd35808983.tar.gz
servo-0ee300479ec22e18ea00d9d1c7c60bdd35808983.zip
Extract device_pixels_per_px from global opts
This is also an embedder specific option, so removing it from the global options makes sense.
Diffstat (limited to 'components/constellation')
-rw-r--r--components/constellation/constellation.rs10
-rw-r--r--components/constellation/pipeline.rs8
2 files changed, 17 insertions, 1 deletions
diff --git a/components/constellation/constellation.rs b/components/constellation/constellation.rs
index 356f530d9ed..a819bd65a1b 100644
--- a/components/constellation/constellation.rs
+++ b/components/constellation/constellation.rs
@@ -464,6 +464,10 @@ pub struct Constellation<Message, LTF, STF> {
/// Mechanism to force the compositor to process events.
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.
+ device_pixels_per_px: Option<f32>,
}
/// State needed to construct a constellation.
@@ -520,6 +524,10 @@ pub struct InitialConstellationState {
/// 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>,
}
/// Data needed for webdriver
@@ -837,6 +845,7 @@ where
glplayer_threads: state.glplayer_threads,
player_context: state.player_context,
event_loop_waker: state.event_loop_waker,
+ device_pixels_per_px,
};
constellation.run();
@@ -1081,6 +1090,7 @@ where
webxr_registry: self.webxr_registry.clone(),
player_context: self.player_context.clone(),
event_loop_waker: self.event_loop_waker.as_ref().map(|w| (*w).clone_box()),
+ device_pixels_per_px: self.device_pixels_per_px,
});
let pipeline = match result {
diff --git a/components/constellation/pipeline.rs b/components/constellation/pipeline.rs
index 373d4820529..2579343f3fe 100644
--- a/components/constellation/pipeline.rs
+++ b/components/constellation/pipeline.rs
@@ -205,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 {
@@ -312,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.
@@ -518,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 {
@@ -609,7 +615,7 @@ impl UnprivilegedPipelineContent {
layout_thread_busy_flag.clone(),
self.opts.load_webfonts_synchronously,
self.opts.initial_window_size,
- self.opts.device_pixels_per_px,
+ self.device_pixels_per_px,
self.opts.dump_display_list,
self.opts.dump_display_list_json,
self.opts.dump_style_tree,