mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
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:
commit
df73c71fb1
40 changed files with 496 additions and 443 deletions
|
@ -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!")
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue