Auto merge of #19135 - paulrouget:resize, r=mbrubeck

do not pass new size to Resize event

It's not necessary to pass the new size to the resize event as it can be retrieved via `WindowMethods::framebuffer_size()`.

From the perspective of the embedder, that makes things a bit easier.

<!-- 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/19135)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-11-07 10:44:51 -06:00 committed by GitHub
commit 9de76632f4
6 changed files with 14 additions and 16 deletions

View file

@ -647,8 +647,8 @@ impl<Window: WindowMethods> IOCompositor<Window> {
}
}
pub fn on_resize_window_event(&mut self, new_size: DeviceUintSize) {
debug!("compositor resizing to {:?}", new_size.to_untyped());
pub fn on_resize_window_event(&mut self) {
debug!("compositor resize requested");
// A size change could also mean a resolution change.
let new_scale_factor = self.window.hidpi_factor();
@ -665,7 +665,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
return;
}
self.frame_size = new_size;
self.frame_size = self.window.framebuffer_size();
self.window_rect = new_window_rect;
self.send_window_size(WindowSizeType::Resize);

View file

@ -49,7 +49,7 @@ pub enum WindowEvent {
/// message, the window must make the same GL context as in `PrepareRenderingEvent` current.
Refresh,
/// Sent when the window is resized.
Resize(DeviceUintSize),
Resize,
/// Touchpad Pressure
TouchpadPressure(TypedPoint2D<f32, DevicePixel>, f32, TouchpadPressurePhase),
/// Sent when a new URL is to be loaded.
@ -93,7 +93,7 @@ impl Debug for WindowEvent {
match *self {
WindowEvent::Idle => write!(f, "Idle"),
WindowEvent::Refresh => write!(f, "Refresh"),
WindowEvent::Resize(..) => write!(f, "Resize"),
WindowEvent::Resize => write!(f, "Resize"),
WindowEvent::TouchpadPressure(..) => write!(f, "TouchpadPressure"),
WindowEvent::KeyEvent(..) => write!(f, "Key"),
WindowEvent::LoadUrl(..) => write!(f, "LoadUrl"),

View file

@ -265,8 +265,8 @@ impl<Window> Servo<Window> where Window: WindowMethods + 'static {
self.compositor.composite();
}
WindowEvent::Resize(size) => {
self.compositor.on_resize_window_event(size);
WindowEvent::Resize => {
self.compositor.on_resize_window_event();
}
WindowEvent::LoadUrl(top_level_browsing_context_id, url) => {