Use WindowMethods to get native graphics metadata instead of

relying on azure. This is a prerequisite for the switch to glutin.

Tested on Linux, mac. Tested that android + cef build.
This commit is contained in:
Glenn Watson 2014-10-24 13:45:42 +10:00
parent 44eec48c57
commit 2d6626e7ef
12 changed files with 49 additions and 9 deletions

View file

@ -25,9 +25,6 @@ use std::rc::Rc;
use url::Url;
#[cfg(target_os="linux")]
use azure::azure_hl;
/// The implementation of the layers-based compositor.
#[deriving(Clone)]
pub struct CompositorChan {
@ -189,11 +186,13 @@ impl CompositorTask {
///
/// FIXME(pcwalton): Probably could be less platform-specific, using the metadata abstraction.
#[cfg(target_os="linux")]
pub fn create_graphics_context() -> NativeCompositingGraphicsContext {
NativeCompositingGraphicsContext::from_display(azure_hl::current_display())
pub fn create_graphics_context(native_metadata: &NativeGraphicsMetadata)
-> NativeCompositingGraphicsContext {
NativeCompositingGraphicsContext::from_display(native_metadata.display)
}
#[cfg(not(target_os="linux"))]
pub fn create_graphics_context() -> NativeCompositingGraphicsContext {
pub fn create_graphics_context(_: &NativeGraphicsMetadata)
-> NativeCompositingGraphicsContext {
NativeCompositingGraphicsContext::new()
}