Implement viewport functions for window #1718

This commit is contained in:
farodin91 2015-09-01 22:14:10 +02:00
parent 9f85370885
commit f0987380dd
14 changed files with 466 additions and 63 deletions

View file

@ -11,11 +11,11 @@ use surface_map::SurfaceMap;
use windowing;
use windowing::{MouseWindowEvent, WindowEvent, WindowMethods, WindowNavigateMsg};
use euclid::Matrix4;
use euclid::point::{Point2D, TypedPoint2D};
use euclid::rect::{Rect, TypedRect};
use euclid::point::TypedPoint2D;
use euclid::rect::TypedRect;
use euclid::scale_factor::ScaleFactor;
use euclid::size::{Size2D, TypedSize2D};
use euclid::size::TypedSize2D;
use euclid::{Size2D, Point2D, Rect, Matrix4};
use gfx::paint_task::{ChromeToPaintMsg, PaintRequest};
use gfx_traits::color;
use gleam::gl;
@ -390,7 +390,8 @@ impl<Window: WindowMethods> IOCompositor<Window> {
self.send_buffer_requests_for_all_layers();
}
(Msg::GetNativeDisplay(chan), ShutdownState::NotShuttingDown) => {
(Msg::GetNativeDisplay(chan),
ShutdownState::NotShuttingDown) => {
chan.send(Some(self.native_display.clone())).unwrap();
}
@ -415,11 +416,27 @@ impl<Window: WindowMethods> IOCompositor<Window> {
self.surface_map.insert_surfaces(&self.native_display, native_surfaces);
}
(Msg::ScrollFragmentPoint(pipeline_id, layer_id, point),
(Msg::ScrollFragmentPoint(pipeline_id, layer_id, point, _),
ShutdownState::NotShuttingDown) => {
self.scroll_fragment_to_point(pipeline_id, layer_id, point);
}
(Msg::MoveTo(point),
ShutdownState::NotShuttingDown) => {
self.window.set_position(point);
}
(Msg::ResizeTo(size),
ShutdownState::NotShuttingDown) => {
self.window.set_inner_size(size);
}
(Msg::GetClientWindow(send),
ShutdownState::NotShuttingDown) => {
let rect = self.window.client_window();
send.send(rect).unwrap();
}
(Msg::Status(message), ShutdownState::NotShuttingDown) => {
self.window.status(message);
}