introduce frame_size and window_rect

This commit is contained in:
Paul Rouget 2017-03-07 02:46:06 +01:00
parent c62973b77b
commit 2a05534efb
4 changed files with 50 additions and 11 deletions

View file

@ -7,6 +7,7 @@
use compositor_thread::{CompositorProxy, CompositorReceiver};
use euclid::{Point2D, Size2D};
use euclid::point::TypedPoint2D;
use euclid::rect::TypedRect;
use euclid::scale_factor::ScaleFactor;
use euclid::size::TypedSize2D;
use msg::constellation_msg::{Key, KeyModifiers, KeyState};
@ -106,8 +107,10 @@ impl Debug for WindowEvent {
}
pub trait WindowMethods {
/// Returns the size of the window in hardware pixels.
/// Returns the rendering area size in hardware pixels.
fn framebuffer_size(&self) -> TypedSize2D<u32, DevicePixel>;
/// Returns the position and size of the window within the rendering area.
fn window_rect(&self) -> TypedRect<u32, DevicePixel>;
/// Returns the size of the window in density-independent "px" units.
fn size(&self) -> TypedSize2D<f32, DeviceIndependentPixel>;
/// Presents the window to the screen (perhaps by page flipping).