Skip to content

Commit fef0506

Browse files
committed
remove WindowMethods::size()
1 parent e25dd45 commit fef0506

2 files changed

Lines changed: 2 additions & 8 deletions

File tree

components/compositing/windowing.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use std::fmt::{Debug, Error, Formatter};
1717
use std::rc::Rc;
1818
use style_traits::DevicePixel;
1919
use style_traits::cursor::CursorKind;
20-
use webrender_api::{DeviceIntPoint, DeviceSize, DevicePoint, DeviceUintSize, DeviceUintRect, ScrollLocation};
20+
use webrender_api::{DeviceIntPoint, DevicePoint, DeviceUintSize, DeviceUintRect, ScrollLocation};
2121

2222
#[derive(Clone)]
2323
pub enum MouseWindowEvent {
@@ -122,8 +122,6 @@ pub trait WindowMethods {
122122
fn framebuffer_size(&self) -> DeviceUintSize;
123123
/// Returns the position and size of the window within the rendering area.
124124
fn window_rect(&self) -> DeviceUintRect;
125-
/// Returns the size of the window.
126-
fn size(&self) -> DeviceSize;
127125
/// Presents the window to the screen (perhaps by page flipping).
128126
fn present(&self);
129127

ports/servo/glutin_app/window.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ impl WindowMethods for Window {
868868
}
869869

870870
fn framebuffer_size(&self) -> DeviceUintSize {
871-
self.size().to_u32()
871+
(self.inner_size.get().to_f32() * self.hidpi_factor()).to_u32()
872872
}
873873

874874
fn window_rect(&self) -> DeviceUintRect {
@@ -877,10 +877,6 @@ impl WindowMethods for Window {
877877
DeviceUintRect::new(origin, size)
878878
}
879879

880-
fn size(&self) -> TypedSize2D<f32, DevicePixel> {
881-
self.inner_size.get().to_f32() * self.hidpi_factor()
882-
}
883-
884880
fn client_window(&self, _: BrowserId) -> (DeviceUintSize, DeviceIntPoint) {
885881
let (size, point) = match self.kind {
886882
WindowKind::Window(ref window, ..) => {

0 commit comments

Comments
 (0)