Backed out changeset c424ad1c5f94 for build failures a=backout CLOSED TREE

Backs out https://github.com/servo/servo/pull/17892
This commit is contained in:
Gecko Backout 2017-07-28 23:21:03 +00:00 committed by moz-servo-sync
parent f022936ebb
commit 3f1af3e62f
14 changed files with 85 additions and 111 deletions

View file

@ -19,7 +19,7 @@ use wrappers::CefWrap;
use compositing::compositor_thread::EventLoopWaker;
use compositing::windowing::{WindowEvent, WindowMethods};
use euclid::{Point2D, TypedPoint2D, Size2D, TypedSize2D, ScaleFactor};
use euclid::{Point2D, TypedPoint2D, TypedRect, Size2D, TypedSize2D, ScaleFactor};
use gleam::gl;
use msg::constellation_msg::{Key, KeyModifiers};
use net_traits::net_error_list::NetError;
@ -38,7 +38,6 @@ use style_traits::DevicePixel;
extern crate x11;
#[cfg(target_os="linux")]
use self::x11::xlib::{XInitThreads,XOpenDisplay};
use webrender_api::{DeviceUintSize, DeviceUintRect};
#[cfg(target_os="linux")]
pub static mut DISPLAY: *mut c_void = 0 as *mut c_void;
@ -47,7 +46,7 @@ pub static mut DISPLAY: *mut c_void = 0 as *mut c_void;
#[derive(Clone)]
pub struct Window {
cef_browser: RefCell<Option<CefBrowser>>,
size: DeviceUintSize,
size: TypedSize2D<u32, DevicePixel>,
gl: Rc<gl::Gl>,
}
@ -175,7 +174,7 @@ impl WindowMethods for Window {
self.gl.clone()
}
fn framebuffer_size(&self) -> DeviceUintSize {
fn framebuffer_size(&self) -> TypedSize2D<u32, DevicePixel> {
let browser = self.cef_browser.borrow();
match *browser {
None => self.size,
@ -206,16 +205,16 @@ impl WindowMethods for Window {
}
}
DeviceUintSize::new(rect.width as u32, rect.height as u32)
TypedSize2D::new(rect.width as u32, rect.height as u32)
}
}
}
}
fn window_rect(&self) -> DeviceUintRect {
fn window_rect(&self) -> TypedRect<u32, DevicePixel> {
let size = self.framebuffer_size();
let origin = TypedPoint2D::zero();
DeviceUintRect::new(origin, size)
TypedRect::new(origin, size)
}
fn size(&self) -> TypedSize2D<f32, DeviceIndependentPixel> {

View file

@ -8,7 +8,7 @@ use NestedEventLoopListener;
use compositing::compositor_thread::EventLoopWaker;
use compositing::windowing::{AnimationState, MouseWindowEvent};
use compositing::windowing::{WindowEvent, WindowMethods};
use euclid::{Point2D, Size2D, TypedPoint2D, TypedVector2D, ScaleFactor, TypedSize2D};
use euclid::{Point2D, Size2D, TypedPoint2D, TypedVector2D, TypedRect, ScaleFactor, TypedSize2D};
#[cfg(target_os = "windows")]
use gdi32;
use gleam::gl;
@ -43,7 +43,7 @@ use style_traits::DevicePixel;
use style_traits::cursor::Cursor;
#[cfg(target_os = "windows")]
use user32;
use webrender_api::{DeviceUintRect, DeviceUintSize, ScrollLocation};
use webrender_api::ScrollLocation;
#[cfg(target_os = "windows")]
use winapi;
@ -962,24 +962,24 @@ impl WindowMethods for Window {
self.gl.clone()
}
fn framebuffer_size(&self) -> DeviceUintSize {
fn framebuffer_size(&self) -> TypedSize2D<u32, DevicePixel> {
match self.kind {
WindowKind::Window(ref window) => {
let scale_factor = window.hidpi_factor() as u32;
// TODO(ajeffrey): can this fail?
let (width, height) = window.get_inner_size().expect("Failed to get window inner size.");
DeviceUintSize::new(width, height) * scale_factor
TypedSize2D::new(width * scale_factor, height * scale_factor)
}
WindowKind::Headless(ref context) => {
DeviceUintSize::new(context.width, context.height)
TypedSize2D::new(context.width, context.height)
}
}
}
fn window_rect(&self) -> DeviceUintRect {
fn window_rect(&self) -> TypedRect<u32, DevicePixel> {
let size = self.framebuffer_size();
let origin = TypedPoint2D::zero();
DeviceUintRect::new(origin, size)
TypedRect::new(origin, size)
}
fn size(&self) -> TypedSize2D<f32, DeviceIndependentPixel> {