diff options
author | Alan Jeffrey <ajeffrey@mozilla.com> | 2020-01-09 17:28:46 -0600 |
---|---|---|
committer | Alan Jeffrey <ajeffrey@mozilla.com> | 2020-04-17 23:44:53 -0500 |
commit | 8bb1732258c44e6850618a8f2fbb2927bc01b090 (patch) | |
tree | e4483e94fd5fbceb15fe9e35e3d5a085d3b2b814 /components/compositing/windowing.rs | |
parent | 9dbc6554f087ca3675104fb1bac45b0c442a0158 (diff) | |
download | servo-8bb1732258c44e6850618a8f2fbb2927bc01b090.tar.gz servo-8bb1732258c44e6850618a8f2fbb2927bc01b090.zip |
Update surfman to 0.2 and remove glutin
Diffstat (limited to 'components/compositing/windowing.rs')
-rw-r--r-- | components/compositing/windowing.rs | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/components/compositing/windowing.rs b/components/compositing/windowing.rs index b3a48026e30..7a2784e08fd 100644 --- a/components/compositing/windowing.rs +++ b/components/compositing/windowing.rs @@ -7,8 +7,6 @@ use canvas::{SurfaceProviders, WebGlExecutor}; use embedder_traits::{EmbedderProxy, EventLoopWaker}; use euclid::Scale; -#[cfg(feature = "gl")] -use gleam::gl; use keyboard_types::KeyboardEvent; use msg::constellation_msg::{PipelineId, TopLevelBrowsingContextId, TraversalDirection}; use script_traits::{MediaSessionActionType, MouseButton, TouchEventType, TouchId, WheelDelta}; @@ -16,14 +14,13 @@ use servo_geometry::DeviceIndependentPixel; use servo_media::player::context::{GlApi, GlContext, NativeDisplay}; use servo_url::ServoUrl; use std::fmt::{Debug, Error, Formatter}; -#[cfg(feature = "gl")] -use std::rc::Rc; use std::time::Duration; use style_traits::DevicePixel; use webrender_api::units::DevicePoint; use webrender_api::units::{DeviceIntPoint, DeviceIntRect, DeviceIntSize}; use webrender_api::ScrollLocation; +use webrender_surfman::WebrenderSurfman; #[derive(Clone)] pub enum MouseWindowEvent { @@ -148,14 +145,10 @@ pub enum AnimationState { Animating, } +// TODO: this trait assumes that the window is responsible +// for creating the GL context, making it current, buffer +// swapping, etc. Really that should all be done by surfman. pub trait WindowMethods { - /// Presents the window to the screen (perhaps by page flipping). - fn present(&self); - /// Make the OpenGL context current. - fn make_gl_context_current(&self); - /// Return the GL function pointer trait. - #[cfg(feature = "gl")] - fn gl(&self) -> Rc<dyn gl::Gl>; /// Get the coordinates of the native window, the screen and the framebuffer. fn get_coordinates(&self) -> EmbedderCoordinates; /// Set whether the application is currently animating. @@ -163,12 +156,14 @@ pub trait WindowMethods { /// will want to avoid blocking on UI events, and just /// run the event loop at the vsync interval. fn set_animation_state(&self, _state: AnimationState); - /// Get the GL context + /// Get the media GL context fn get_gl_context(&self) -> GlContext; - /// Get the native display + /// Get the media native display fn get_native_display(&self) -> NativeDisplay; /// Get the GL api fn get_gl_api(&self) -> GlApi; + /// Get the webrender surfman instance + fn webrender_surfman(&self) -> WebrenderSurfman; } pub trait EmbedderMethods { |