aboutsummaryrefslogtreecommitdiffstats
path: root/components/servo/lib.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2019-07-12 08:10:31 -0400
committerGitHub <noreply@github.com>2019-07-12 08:10:31 -0400
commitdf73c71fb18c144abedd6889c34dd1031ffcbb8e (patch)
treea5d41e6bf6a78b390fb7e0b2bb1f5ed22c936c64 /components/servo/lib.rs
parent026e550d3536115b23ad794e08b3c93147913dfb (diff)
parent30ea2827209c3c6982c4552c7d3f1193883025b1 (diff)
downloadservo-df73c71fb18c144abedd6889c34dd1031ffcbb8e.tar.gz
servo-df73c71fb18c144abedd6889c34dd1031ffcbb8e.zip
Auto merge of #23516 - pcwalton:webrenderup, r=pcwalton,jdm
Upgrade WebRender This is against an old Servo because I can't build current Servo due to compile errors in RNG crates. I verified that it starts up. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #23516 - [x] There are tests for these changes <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23516) <!-- Reviewable:end -->
Diffstat (limited to 'components/servo/lib.rs')
-rw-r--r--components/servo/lib.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/components/servo/lib.rs b/components/servo/lib.rs
index 6f7c0228524..71e679b1b6f 100644
--- a/components/servo/lib.rs
+++ b/components/servo/lib.rs
@@ -84,6 +84,7 @@ use constellation::{FromCompositorLogger, FromScriptLogger};
use crossbeam_channel::{unbounded, Sender};
use embedder_traits::{EmbedderMsg, EmbedderProxy, EmbedderReceiver, EventLoopWaker};
use env_logger::Builder as EnvLoggerBuilder;
+use euclid::TypedSize2D;
#[cfg(all(
not(target_os = "windows"),
not(target_os = "ios"),
@@ -304,11 +305,19 @@ where
let render_notifier = Box::new(RenderNotifier::new(compositor_proxy.clone()));
+ // Cast from `DeviceIndependentPixel` to `DevicePixel`
+ let device_pixel_ratio = coordinates.hidpi_factor.get();
+ let window_size = TypedSize2D::from_untyped(
+ &(opts.initial_window_size.to_f32() / device_pixel_ratio)
+ .to_i32()
+ .to_untyped(),
+ );
+
webrender::Renderer::new(
window.gl(),
render_notifier,
webrender::RendererOptions {
- device_pixel_ratio: coordinates.hidpi_factor.get(),
+ device_pixel_ratio,
resource_override_path: opts.shaders_dir.clone(),
enable_aa: opts.enable_text_antialiasing,
debug_flags: debug_flags,
@@ -324,6 +333,7 @@ where
..Default::default()
},
None,
+ window_size,
)
.expect("Unable to initialize webrender!")
};