Commit 2f99b78f authored by Patrick To's avatar Patrick To Committed by Commit Bot

Initially send the correct display info for WMR

The XR process initially sends back dummy values (1024) to the renderer
for the display's width/height and later sends back the correct values
on the first frame.

However, in WebVR, most web pages do not look for the updated values
after entering the rendering loop. As a result, WebVR pages present
with a resolution of 1024 until the user exit presentation and then
re-enters presentation without refreshing the page.

In WebXR, Blink does not update the XRWebGLLayer's width/height when
the XR process sends back the correct values, so presentation also
occurs at 1024 until exiting and re-entering presentation.

This change updates the display info in the XR process and initially
sends back the correct value so that both WebVR and WebXR pages has the
correct width/height when starting presentation.

Bug: 1000897
Change-Id: I3491d43245bb53100212fd2d0ab38d8f1222e7c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1785883Reviewed-by: default avatarAlexander Cooper <alcooper@chromium.org>
Commit-Queue: Patrick To <patrto@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#695856}
parent 50206e46
......@@ -252,7 +252,15 @@ bool MixedRealityRenderLoop::StartRuntime() {
if (FAILED(hr))
return false;
return holographic_space_->TrySetDirect3D11Device(device);
if (!holographic_space_->TrySetDirect3D11Device(device))
return false;
// Go through one initial dummy frame to update the display info and notify
// the device of the correct values before it sends the initial info to the
// renderer. The frame must be submitted because WMR requires frames to be
// submitted in the order they're created.
GetNextFrameData();
return SubmitCompositedFrame();
}
void MixedRealityRenderLoop::StopRuntime() {
......
......@@ -52,6 +52,15 @@ MockWMRHolographicFrame::TryGetRenderingParameters(const WMRCameraPose* pose) {
}
bool MockWMRHolographicFrame::TryPresentUsingCurrentPrediction() {
// A dummy frame is created when a session first starts to retrieve
// information about the headset. Submitting this frame should not notify
// the test hook.
static bool first_frame = true;
if (first_frame) {
first_frame = false;
return true;
}
// If we don't actually have a texture to submit, don't try.
if (!backbuffer_texture_)
return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment