mirror of
https://github.com/servo/servo.git
synced 2025-08-25 15:18:22 +01:00
Update to latest rust-layers
The compositing context, painting context and display metadata have all been collapsed into a single NativeDisplay class.
This commit is contained in:
parent
b7923547a7
commit
0f27bd6c4b
13 changed files with 71 additions and 108 deletions
|
@ -21,7 +21,7 @@ use euclid::scale_factor::ScaleFactor;
|
|||
use euclid::size::{Size2D, TypedSize2D};
|
||||
use gleam::gl;
|
||||
use layers::geometry::DevicePixel;
|
||||
use layers::platform::surface::NativeGraphicsMetadata;
|
||||
use layers::platform::surface::NativeDisplay;
|
||||
use libc::{c_char, c_void};
|
||||
use msg::constellation_msg::{Key, KeyModifiers};
|
||||
use net::net_error_list::NetError;
|
||||
|
@ -265,26 +265,17 @@ impl WindowMethods for Window {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(target_os="macos")]
|
||||
fn native_metadata(&self) -> NativeGraphicsMetadata {
|
||||
use cgl::{CGLGetCurrentContext, CGLGetPixelFormat};
|
||||
|
||||
// FIXME(pcwalton)
|
||||
#[cfg(target_os="linux")]
|
||||
fn native_display(&self) -> NativeDisplay {
|
||||
use x11::xlib;
|
||||
unsafe {
|
||||
NativeGraphicsMetadata {
|
||||
pixel_format: CGLGetPixelFormat(CGLGetCurrentContext()),
|
||||
}
|
||||
NativeDisplay::new(DISPLAY as *mut xlib::Display)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_os="linux")]
|
||||
fn native_metadata(&self) -> NativeGraphicsMetadata {
|
||||
use x11::xlib;
|
||||
unsafe {
|
||||
NativeGraphicsMetadata {
|
||||
display: DISPLAY as *mut xlib::Display,
|
||||
}
|
||||
}
|
||||
#[cfg(not(target_os="linux"))]
|
||||
fn native_display(&self) -> NativeDisplay {
|
||||
NativeDisplay::new()
|
||||
}
|
||||
|
||||
fn create_compositor_channel(_: &Option<Rc<Window>>)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue