diff options
Diffstat (limited to 'components/canvas_traits/webgl.rs')
-rw-r--r-- | components/canvas_traits/webgl.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/components/canvas_traits/webgl.rs b/components/canvas_traits/webgl.rs index dc3c8530249..6ac103f629f 100644 --- a/components/canvas_traits/webgl.rs +++ b/components/canvas_traits/webgl.rs @@ -76,6 +76,12 @@ pub enum WebGLMsg { Exit, } +#[derive(Clone, Copy, Debug, Deserialize, MallocSizeOf, PartialEq, Serialize)] +pub enum GlType { + Gl, + Gles, +} + /// Contains the WebGLCommand sender and information about a WebGLContext #[derive(Clone, Debug, Deserialize, Serialize)] pub struct WebGLCreateContextResult { @@ -87,6 +93,8 @@ pub struct WebGLCreateContextResult { pub share_mode: WebGLContextShareMode, /// The GLSL version supported by the context. pub glsl_version: WebGLSLVersion, + /// The GL API used by the context. + pub api_type: GlType, } #[derive(Clone, Copy, Debug, Deserialize, MallocSizeOf, Serialize)] @@ -761,12 +769,6 @@ parameters! { } } -pub fn is_gles() -> bool { - // TODO: align this with the actual kind of graphics context in use, rather than - // making assumptions based on platform - cfg!(any(target_os = "android", target_os = "ios")) -} - #[macro_export] macro_rules! gl_enums { ($(pub enum $name:ident { $($variant:ident = $mod:ident::$constant:ident,)+ })*) => { |