Skip to content

Commit

Permalink
Add stub makeXRCompatible()
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Jun 11, 2019
1 parent 52b0d37 commit 2af8e0e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
10 changes: 10 additions & 0 deletions components/script/dom/webglrenderingcontext.rs
Expand Up @@ -24,6 +24,7 @@ use crate::dom::htmlcanvaselement::utils as canvas_utils;
use crate::dom::htmlcanvaselement::HTMLCanvasElement; use crate::dom::htmlcanvaselement::HTMLCanvasElement;
use crate::dom::htmliframeelement::HTMLIFrameElement; use crate::dom::htmliframeelement::HTMLIFrameElement;
use crate::dom::node::{document_from_node, window_from_node, Node, NodeDamage}; use crate::dom::node::{document_from_node, window_from_node, Node, NodeDamage};
use crate::dom::promise::Promise;
use crate::dom::webgl_extensions::WebGLExtensions; use crate::dom::webgl_extensions::WebGLExtensions;
use crate::dom::webgl_validations::tex_image_2d::{ use crate::dom::webgl_validations::tex_image_2d::{
CommonCompressedTexImage2DValidatorResult, CommonTexImage2DValidator, CommonCompressedTexImage2DValidatorResult, CommonTexImage2DValidator,
Expand Down Expand Up @@ -76,6 +77,7 @@ use servo_config::pref;
use std::cell::Cell; use std::cell::Cell;
use std::cmp; use std::cmp;
use std::ptr::{self, NonNull}; use std::ptr::{self, NonNull};
use std::rc::Rc;


// From the GLES 2.0.25 spec, page 85: // From the GLES 2.0.25 spec, page 85:
// //
Expand Down Expand Up @@ -4090,6 +4092,14 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
handle_potential_webgl_error!(self, self.validate_ownership(program), return None); handle_potential_webgl_error!(self, self.validate_ownership(program), return None);
handle_potential_webgl_error!(self, program.attached_shaders().map(Some), None) handle_potential_webgl_error!(self, program.attached_shaders().map(Some), None)
} }

/// https://immersive-web.github.io/webxr/#dom-webglrenderingcontextbase-makexrcompatible
fn MakeXRCompatible(&self) -> Rc<Promise> {
// XXXManishearth Fill in with compatibility checks when rust-webxr supports this
let p = Promise::new(&self.global());
p.resolve_native(&());
p
}
} }


pub trait LayoutCanvasWebGLRenderingContextHelpers { pub trait LayoutCanvasWebGLRenderingContextHelpers {
Expand Down
1 change: 0 additions & 1 deletion components/script/dom/webidls/XRSession.webidl
Expand Up @@ -44,4 +44,3 @@ interface XRSession : EventTarget {
// attribute EventHandler onselectstart; // attribute EventHandler onselectstart;
// attribute EventHandler onselectend; // attribute EventHandler onselectend;
}; };

4 changes: 4 additions & 0 deletions components/script/dom/webidls/XRWebGLLayer.webidl
Expand Up @@ -41,3 +41,7 @@ interface XRWebGLLayer : XRLayer {
// // Static Methods // // Static Methods
// static double getNativeFramebufferScaleFactor(XRSession session); // static double getNativeFramebufferScaleFactor(XRSession session);
}; };

partial interface WebGLRenderingContext {
[Pref="dom.webxr.enabled"] Promise<void> makeXRCompatible();
};

0 comments on commit 2af8e0e

Please sign in to comment.