aboutsummaryrefslogtreecommitdiffstats
path: root/components/canvas_traits/webgl.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2019-07-10 17:34:16 -0400
committerJosh Matthews <josh@joshmatthews.net>2019-07-12 13:36:44 -0400
commitdbaed5ed9276843ae3aa10f8671f65db839b7ffe (patch)
tree8493b7aa58d3e19cf558ebd5d346e5ea2ae897c4 /components/canvas_traits/webgl.rs
parent812bf8d816d29ecf132ff15a2da6a83c690e2e48 (diff)
downloadservo-dbaed5ed9276843ae3aa10f8671f65db839b7ffe.tar.gz
servo-dbaed5ed9276843ae3aa10f8671f65db839b7ffe.zip
Make GL/GLES decisions based on the API in use.
Diffstat (limited to 'components/canvas_traits/webgl.rs')
-rw-r--r--components/canvas_traits/webgl.rs14
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,)+ })*) => {