mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Remove layers dependency from util
This commit is contained in:
parent
fdb8632a5f
commit
8570b22677
8 changed files with 4 additions and 13 deletions
|
@ -1055,7 +1055,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
||||||
|
|
||||||
fn device_pixels_per_screen_px(&self) -> ScaleFactor<ScreenPx, DevicePixel, f32> {
|
fn device_pixels_per_screen_px(&self) -> ScaleFactor<ScreenPx, DevicePixel, f32> {
|
||||||
match opts::get().device_pixels_per_px {
|
match opts::get().device_pixels_per_px {
|
||||||
Some(device_pixels_per_px) => device_pixels_per_px,
|
Some(device_pixels_per_px) => ScaleFactor::new(device_pixels_per_px),
|
||||||
None => match opts::get().output_file {
|
None => match opts::get().output_file {
|
||||||
Some(_) => ScaleFactor::new(1.0),
|
Some(_) => ScaleFactor::new(1.0),
|
||||||
None => self.hidpi_factor
|
None => self.hidpi_factor
|
||||||
|
|
1
components/servo/Cargo.lock
generated
1
components/servo/Cargo.lock
generated
|
@ -1304,7 +1304,6 @@ dependencies = [
|
||||||
"bitflags 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"bitflags 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"cssparser 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"cssparser 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"euclid 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"euclid 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"layers 0.1.0 (git+https://github.com/servo/rust-layers)",
|
|
||||||
"lazy_static 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
"lazy_static 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
|
|
@ -24,9 +24,6 @@ git = "https://github.com/servo/rust-selectors"
|
||||||
[dependencies.azure]
|
[dependencies.azure]
|
||||||
git = "https://github.com/servo/rust-azure"
|
git = "https://github.com/servo/rust-azure"
|
||||||
|
|
||||||
[dependencies.layers]
|
|
||||||
git = "https://github.com/servo/rust-layers"
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
log = "*"
|
log = "*"
|
||||||
bitflags = "*"
|
bitflags = "*"
|
||||||
|
|
|
@ -28,7 +28,6 @@ extern crate alloc;
|
||||||
#[macro_use] extern crate cssparser;
|
#[macro_use] extern crate cssparser;
|
||||||
extern crate euclid;
|
extern crate euclid;
|
||||||
extern crate getopts;
|
extern crate getopts;
|
||||||
extern crate layers;
|
|
||||||
extern crate libc;
|
extern crate libc;
|
||||||
extern crate num as num_lib;
|
extern crate num as num_lib;
|
||||||
extern crate num_cpus;
|
extern crate num_cpus;
|
||||||
|
|
|
@ -7,9 +7,7 @@
|
||||||
|
|
||||||
use geometry::ScreenPx;
|
use geometry::ScreenPx;
|
||||||
|
|
||||||
use euclid::scale_factor::ScaleFactor;
|
|
||||||
use euclid::size::{Size2D, TypedSize2D};
|
use euclid::size::{Size2D, TypedSize2D};
|
||||||
use layers::geometry::DevicePixel;
|
|
||||||
use getopts;
|
use getopts;
|
||||||
use num_cpus;
|
use num_cpus;
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
|
@ -44,7 +42,7 @@ pub struct Opts {
|
||||||
|
|
||||||
/// The ratio of device pixels per px at the default scale. If unspecified, will use the
|
/// The ratio of device pixels per px at the default scale. If unspecified, will use the
|
||||||
/// platform default setting.
|
/// platform default setting.
|
||||||
pub device_pixels_per_px: Option<ScaleFactor<ScreenPx, DevicePixel, f32>>,
|
pub device_pixels_per_px: Option<f32>,
|
||||||
|
|
||||||
/// `None` to disable the time profiler or `Some` with an interval in seconds to enable it and
|
/// `None` to disable the time profiler or `Some` with an interval in seconds to enable it and
|
||||||
/// cause it to produce output on that interval (`-p`).
|
/// cause it to produce output on that interval (`-p`).
|
||||||
|
@ -328,7 +326,7 @@ pub fn from_cmdline_args(args: &[String]) {
|
||||||
};
|
};
|
||||||
|
|
||||||
let device_pixels_per_px = opt_match.opt_str("device-pixel-ratio").map(|dppx_str|
|
let device_pixels_per_px = opt_match.opt_str("device-pixel-ratio").map(|dppx_str|
|
||||||
ScaleFactor::new(dppx_str.parse().unwrap())
|
dppx_str.parse().unwrap()
|
||||||
);
|
);
|
||||||
|
|
||||||
let mut paint_threads: usize = match opt_match.opt_str("t") {
|
let mut paint_threads: usize = match opt_match.opt_str("t") {
|
||||||
|
|
1
ports/cef/Cargo.lock
generated
1
ports/cef/Cargo.lock
generated
|
@ -1288,7 +1288,6 @@ dependencies = [
|
||||||
"bitflags 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"bitflags 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"cssparser 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"cssparser 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"euclid 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"euclid 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"layers 0.1.0 (git+https://github.com/servo/rust-layers)",
|
|
||||||
"lazy_static 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
"lazy_static 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
|
|
@ -41,7 +41,7 @@ pub fn create_window(parent: WindowID) -> Rc<Window> {
|
||||||
// Read command-line options.
|
// Read command-line options.
|
||||||
let opts = opts::get();
|
let opts = opts::get();
|
||||||
let foreground = opts.output_file.is_none();
|
let foreground = opts.output_file.is_none();
|
||||||
let scale_factor = opts.device_pixels_per_px.unwrap_or(ScaleFactor::new(1.0));
|
let scale_factor = ScaleFactor::new(opts.device_pixels_per_px.unwrap_or(1.0));
|
||||||
let size = opts.initial_window_size.as_f32() * scale_factor;
|
let size = opts.initial_window_size.as_f32() * scale_factor;
|
||||||
|
|
||||||
// Open a window.
|
// Open a window.
|
||||||
|
|
1
ports/gonk/Cargo.lock
generated
1
ports/gonk/Cargo.lock
generated
|
@ -1177,7 +1177,6 @@ dependencies = [
|
||||||
"bitflags 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"bitflags 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"cssparser 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"cssparser 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"euclid 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"euclid 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"layers 0.1.0 (git+https://github.com/servo/rust-layers)",
|
|
||||||
"lazy_static 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
"lazy_static 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue