зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1555528 [wpt PR 17089] - Simplifying inline WebXR rendering, a=testonly
Automatic update from web-platform-tests Simplifying inline WebXR rendering Removes XRPresentationContext and adds the 'compositionDisabled' option to XRWebGLLayerInit. Bug: 968321 Change-Id: I9dbdd70b66e01f0df6182fbd8238a689365e93dd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1633231 Commit-Queue: Brandon Jones <bajones@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Reviewed-by: Jeremy Roman <jbroman@chromium.org> Reviewed-by: Klaus Weidner <klausw@chromium.org> Cr-Commit-Position: refs/heads/master@{#665075} -- wp5At-commits: b6523af4883a9b9db729fbcd6c411ae1441676d9 wpt-pr: 17089
This commit is contained in:
Родитель
05bf7148ce
Коммит
5aaadbc6d2
|
@ -52,11 +52,13 @@ function xr_session_promise_test(
|
|||
.then((session) => {
|
||||
testSession = session;
|
||||
session.mode = sessionMode;
|
||||
let glLayer = new XRWebGLLayer(session, gl, {
|
||||
compositionDisabled: session.mode == 'inline'
|
||||
});
|
||||
// Session must have a baseLayer or frame requests
|
||||
// will be ignored.
|
||||
session.updateRenderState({
|
||||
baseLayer: new XRWebGLLayer(session, gl),
|
||||
outputContext: getOutputContext()
|
||||
baseLayer: glLayer
|
||||
});
|
||||
resolve(func(session, testDeviceController, t));
|
||||
})
|
||||
|
@ -78,15 +80,6 @@ function xr_session_promise_test(
|
|||
properties);
|
||||
}
|
||||
|
||||
// A utility function to create an output context as required by non-immersive
|
||||
// sessions.
|
||||
// https://immersive-web.github.io/webxr/#xrsessioncreationoptions-interface
|
||||
function getOutputContext() {
|
||||
let outputCanvas = document.createElement('canvas');
|
||||
document.body.appendChild(outputCanvas);
|
||||
return outputCanvas.getContext('xrpresent');
|
||||
}
|
||||
|
||||
// This functions calls a callback with each API object as specified
|
||||
// by https://immersive-web.github.io/webxr/spec/latest/, allowing
|
||||
// checks to be made on all ojects.
|
||||
|
|
|
@ -1,59 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<body>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<script src="resources/webxr_util.js"></script>
|
||||
<canvas></canvas>
|
||||
<script>
|
||||
xr_promise_test(
|
||||
"Ensure that XRPresentationContexts are properly transfered between session",
|
||||
(t) => {
|
||||
return XRTest.simulateDeviceConnection({ supportsImmersive:false })
|
||||
.then( (controller) => {
|
||||
return Promise.all([
|
||||
navigator.xr.requestSession('inline'),
|
||||
navigator.xr.requestSession('inline')
|
||||
]).then((sessions) => {
|
||||
t.step(() => {
|
||||
assert_not_equals(sessions[0], null);
|
||||
assert_not_equals(sessions[1], null);
|
||||
});
|
||||
|
||||
const webglCanvas = document.getElementsByTagName('canvas')[0];
|
||||
let gl = webglCanvas.getContext('webgl', {xrCompatible: true});
|
||||
let outputContext = getOutputContext();
|
||||
|
||||
sessions[0].updateRenderState({
|
||||
baseLayer: new XRWebGLLayer(sessions[0], gl),
|
||||
outputContext: outputContext
|
||||
});
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
sessions[0].requestAnimationFrame((time, xrFrame) => {
|
||||
sessions[1].updateRenderState({
|
||||
baseLayer: new XRWebGLLayer(sessions[1], gl),
|
||||
outputContext: outputContext
|
||||
});
|
||||
|
||||
t.step(() => {
|
||||
// outputContext reassignment should not happen until the next frame is processed.
|
||||
assert_equals(sessions[0].renderState.outputContext, outputContext);
|
||||
assert_equals(sessions[1].renderState.outputContext, null);
|
||||
});
|
||||
|
||||
sessions[1].requestAnimationFrame((time, xrFrame) => {
|
||||
t.step(() => {
|
||||
// Ensure the outputContext was properly reassigned from one context to the other.
|
||||
assert_equals(sessions[0].renderState.outputContext, null);
|
||||
assert_equals(sessions[1].renderState.outputContext, outputContext);
|
||||
});
|
||||
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
Загрузка…
Ссылка в новой задаче