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 -->
This commit is contained in:
bors-servo 2019-07-12 08:10:31 -04:00 committed by GitHub
commit df73c71fb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 496 additions and 443 deletions

View file

@ -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!")
};