mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Change opts to work in screen pixels that are scaled to device pixels.
This commit is contained in:
parent
c2522ec127
commit
ff4713c434
2 changed files with 9 additions and 2 deletions
|
@ -142,8 +142,15 @@ impl IOCompositor {
|
||||||
constellation_chan: ConstellationChan,
|
constellation_chan: ConstellationChan,
|
||||||
time_profiler_chan: TimeProfilerChan,
|
time_profiler_chan: TimeProfilerChan,
|
||||||
memory_profiler_chan: MemoryProfilerChan) -> IOCompositor {
|
memory_profiler_chan: MemoryProfilerChan) -> IOCompositor {
|
||||||
|
|
||||||
|
let scale_factor = match opts.device_pixels_per_px {
|
||||||
|
Some(device_pixels_per_px) => device_pixels_per_px,
|
||||||
|
None => ScaleFactor(1.0),
|
||||||
|
};
|
||||||
|
let framebuffer_size = opts.initial_window_size.as_f32() * scale_factor;
|
||||||
|
|
||||||
let window: Rc<Window> = WindowMethods::new(app, opts.output_file.is_none(),
|
let window: Rc<Window> = WindowMethods::new(app, opts.output_file.is_none(),
|
||||||
opts.initial_window_size);
|
framebuffer_size.as_uint());
|
||||||
|
|
||||||
// Create an initial layer tree.
|
// Create an initial layer tree.
|
||||||
//
|
//
|
||||||
|
|
|
@ -89,7 +89,7 @@ pub struct Opts {
|
||||||
pub devtools_server: bool,
|
pub devtools_server: bool,
|
||||||
|
|
||||||
/// The initial requested size of the window.
|
/// The initial requested size of the window.
|
||||||
pub initial_window_size: TypedSize2D<DevicePixel, uint>,
|
pub initial_window_size: TypedSize2D<ScreenPx, uint>,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn print_usage(app: &str, opts: &[getopts::OptGroup]) {
|
fn print_usage(app: &str, opts: &[getopts::OptGroup]) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue