Skip to content
Permalink
Browse files

Add stub makeXRCompatible()

  • Loading branch information...
Manishearth committed Jun 10, 2019
1 parent 52b0d37 commit 2af8e0ef9fb8e3672bce3e3a423d6ed67ac4c738
@@ -24,6 +24,7 @@ use crate::dom::htmlcanvaselement::utils as canvas_utils;
use crate::dom::htmlcanvaselement::HTMLCanvasElement;
use crate::dom::htmliframeelement::HTMLIFrameElement;
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_validations::tex_image_2d::{
CommonCompressedTexImage2DValidatorResult, CommonTexImage2DValidator,
@@ -76,6 +77,7 @@ use servo_config::pref;
use std::cell::Cell;
use std::cmp;
use std::ptr::{self, NonNull};
use std::rc::Rc;

// From the GLES 2.0.25 spec, page 85:
//
@@ -4090,6 +4092,14 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
handle_potential_webgl_error!(self, self.validate_ownership(program), return 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 {
@@ -44,4 +44,3 @@ interface XRSession : EventTarget {
// attribute EventHandler onselectstart;
// attribute EventHandler onselectend;
};

@@ -41,3 +41,7 @@ interface XRWebGLLayer : XRLayer {
// // Static Methods
// 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.
You can’t perform that action at this time.