From fef0506269495545c5ee9ca5957904bbcb130bb9 Mon Sep 17 00:00:00 2001 From: Paul Rouget Date: Fri, 16 Mar 2018 14:58:17 +0800 Subject: [PATCH] remove WindowMethods::size() --- components/compositing/windowing.rs | 4 +--- ports/servo/glutin_app/window.rs | 6 +----- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/components/compositing/windowing.rs b/components/compositing/windowing.rs index 5ada92b3249d..9b4790c88975 100644 --- a/components/compositing/windowing.rs +++ b/components/compositing/windowing.rs @@ -17,7 +17,7 @@ use std::fmt::{Debug, Error, Formatter}; use std::rc::Rc; use style_traits::DevicePixel; use style_traits::cursor::CursorKind; -use webrender_api::{DeviceIntPoint, DeviceSize, DevicePoint, DeviceUintSize, DeviceUintRect, ScrollLocation}; +use webrender_api::{DeviceIntPoint, DevicePoint, DeviceUintSize, DeviceUintRect, ScrollLocation}; #[derive(Clone)] pub enum MouseWindowEvent { @@ -122,8 +122,6 @@ pub trait WindowMethods { fn framebuffer_size(&self) -> DeviceUintSize; /// Returns the position and size of the window within the rendering area. fn window_rect(&self) -> DeviceUintRect; - /// Returns the size of the window. - fn size(&self) -> DeviceSize; /// Presents the window to the screen (perhaps by page flipping). fn present(&self); diff --git a/ports/servo/glutin_app/window.rs b/ports/servo/glutin_app/window.rs index b472ca5b0abd..384fac204ad3 100644 --- a/ports/servo/glutin_app/window.rs +++ b/ports/servo/glutin_app/window.rs @@ -868,7 +868,7 @@ impl WindowMethods for Window { } fn framebuffer_size(&self) -> DeviceUintSize { - self.size().to_u32() + (self.inner_size.get().to_f32() * self.hidpi_factor()).to_u32() } fn window_rect(&self) -> DeviceUintRect { @@ -877,10 +877,6 @@ impl WindowMethods for Window { DeviceUintRect::new(origin, size) } - fn size(&self) -> TypedSize2D { - self.inner_size.get().to_f32() * self.hidpi_factor() - } - fn client_window(&self, _: BrowserId) -> (DeviceUintSize, DeviceIntPoint) { let (size, point) = match self.kind { WindowKind::Window(ref window, ..) => {