mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
servoshell: Remove redundant WindowEvent::Resized
handler (#38307)
They are redundant as marked in #38174 as rendering related rect already updated in `minibrowser::update`. As a result, we are able to remove `window_rendering_context` and `inner_size` fields from `struct Window`. Testing: No regression/behaviour change in all tests running with headed window. Fixes: https://github.com/servo/servo/issues/38255#issuecomment-3117642340 Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
This commit is contained in:
parent
239bdd7c1a
commit
61273a4321
1 changed files with 0 additions and 17 deletions
|
@ -58,9 +58,6 @@ use crate::prefs::ServoShellPreferences;
|
||||||
|
|
||||||
pub struct Window {
|
pub struct Window {
|
||||||
screen_size: Size2D<u32, DeviceIndependentPixel>,
|
screen_size: Size2D<u32, DeviceIndependentPixel>,
|
||||||
/// The inner size of the window in physical pixels which excludes OS decorations.
|
|
||||||
/// It equals viewport size + (0, toolbar height).
|
|
||||||
inner_size: Cell<PhysicalSize<u32>>,
|
|
||||||
toolbar_height: Cell<Length<f32, DeviceIndependentPixel>>,
|
toolbar_height: Cell<Length<f32, DeviceIndependentPixel>>,
|
||||||
monitor: winit::monitor::MonitorHandle,
|
monitor: winit::monitor::MonitorHandle,
|
||||||
webview_relative_mouse_point: Cell<Point2D<f32, DevicePixel>>,
|
webview_relative_mouse_point: Cell<Point2D<f32, DevicePixel>>,
|
||||||
|
@ -73,11 +70,6 @@ pub struct Window {
|
||||||
xr_window_poses: RefCell<Vec<Rc<XRWindowPose>>>,
|
xr_window_poses: RefCell<Vec<Rc<XRWindowPose>>>,
|
||||||
modifiers_state: Cell<ModifiersState>,
|
modifiers_state: Cell<ModifiersState>,
|
||||||
|
|
||||||
/// The RenderingContext that renders directly onto the Window. This is used as
|
|
||||||
/// the target of egui rendering and also where Servo rendering results are finally
|
|
||||||
/// blitted.
|
|
||||||
window_rendering_context: Rc<WindowRenderingContext>,
|
|
||||||
|
|
||||||
/// The `RenderingContext` of Servo itself. This is used to render Servo results
|
/// The `RenderingContext` of Servo itself. This is used to render Servo results
|
||||||
/// temporarily until they can be blitted into the egui scene.
|
/// temporarily until they can be blitted into the egui scene.
|
||||||
rendering_context: Rc<OffscreenRenderingContext>,
|
rendering_context: Rc<OffscreenRenderingContext>,
|
||||||
|
@ -166,14 +158,12 @@ impl Window {
|
||||||
last_pressed: Cell::new(None),
|
last_pressed: Cell::new(None),
|
||||||
keys_down: RefCell::new(HashMap::new()),
|
keys_down: RefCell::new(HashMap::new()),
|
||||||
fullscreen: Cell::new(false),
|
fullscreen: Cell::new(false),
|
||||||
inner_size: Cell::new(inner_size),
|
|
||||||
monitor,
|
monitor,
|
||||||
screen_size,
|
screen_size,
|
||||||
device_pixel_ratio_override: servoshell_preferences.device_pixel_ratio_override,
|
device_pixel_ratio_override: servoshell_preferences.device_pixel_ratio_override,
|
||||||
xr_window_poses: RefCell::new(vec![]),
|
xr_window_poses: RefCell::new(vec![]),
|
||||||
modifiers_state: Cell::new(ModifiersState::empty()),
|
modifiers_state: Cell::new(ModifiersState::empty()),
|
||||||
toolbar_height: Cell::new(Default::default()),
|
toolbar_height: Cell::new(Default::default()),
|
||||||
window_rendering_context,
|
|
||||||
rendering_context,
|
rendering_context,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -681,13 +671,6 @@ impl WindowPortsMethods for Window {
|
||||||
WindowEvent::CloseRequested => {
|
WindowEvent::CloseRequested => {
|
||||||
state.servo().start_shutting_down();
|
state.servo().start_shutting_down();
|
||||||
},
|
},
|
||||||
WindowEvent::Resized(new_inner_size) => {
|
|
||||||
if self.inner_size.get() != new_inner_size {
|
|
||||||
self.inner_size.set(new_inner_size);
|
|
||||||
// `WebView::move_resize` was already called in `Minibrowser::update`.
|
|
||||||
self.window_rendering_context.resize(new_inner_size);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
WindowEvent::ThemeChanged(theme) => {
|
WindowEvent::ThemeChanged(theme) => {
|
||||||
webview.notify_theme_change(match theme {
|
webview.notify_theme_change(match theme {
|
||||||
winit::window::Theme::Light => Theme::Light,
|
winit::window::Theme::Light => Theme::Light,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue