Commit a1277e26 authored by Alex Cooper's avatar Alex Cooper Committed by Commit Bot

Fix Processing of Inline XR Frame Data

events_referenceSpace_Reset_inline was always timing out because the
reset event was never sent. It turns out that this is because the
frame_data that was being used to process inline sessions was always
nullptr, rather than using the frame data associated with a particular
inline session. This change modifies the requesting_sessions_ map to
store the frame data rather than just the pose, and to process the frame
data for a particular session with that session.

Fixed: 1015195
Change-Id: I3a5d1b619869b57c270304f46bd19b43685869bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2062897
Commit-Queue: Alexander Cooper <alcooper@chromium.org>
Commit-Queue: Klaus Weidner <klausw@chromium.org>
Auto-Submit: Alexander Cooper <alcooper@chromium.org>
Reviewed-by: default avatarKlaus Weidner <klausw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#742333}
parent 99e3133e
...@@ -325,7 +325,7 @@ void XRFrameProvider::OnNonImmersiveFrameData( ...@@ -325,7 +325,7 @@ void XRFrameProvider::OnNonImmersiveFrameData(
} }
if (frame_data) { if (frame_data) {
request->value = std::move(frame_data->pose); request->value = std::move(frame_data);
} else { } else {
// Unexpectedly didn't get frame data, and we don't have a timestamp. // Unexpectedly didn't get frame data, and we don't have a timestamp.
// Try to request a regular animation frame to avoid getting stuck. // Try to request a regular animation frame to avoid getting stuck.
...@@ -446,13 +446,15 @@ void XRFrameProvider::ProcessScheduledFrame( ...@@ -446,13 +446,15 @@ void XRFrameProvider::ProcessScheduledFrame(
if (session->ended()) if (session->ended())
continue; continue;
const auto& frame_pose = request.value; const auto& inline_frame_data = request.value;
device::mojom::blink::VRPosePtr inline_pose_data =
inline_frame_data ? std::move(inline_frame_data->pose) : nullptr;
// Prior to updating input source state, update the state needed to create // Prior to updating input source state, update the state needed to create
// presentation frame as newly created presentation frame will get passed // presentation frame as newly created presentation frame will get passed
// to the input source select[/start/end] events. // to the input source select[/start/end] events.
session->UpdatePresentationFrameState( session->UpdatePresentationFrameState(
high_res_now_ms, frame_pose, frame_data, frame_id_, high_res_now_ms, inline_pose_data, inline_frame_data, frame_id_,
true /* Non-immersive positions are always emulated */); true /* Non-immersive positions are always emulated */);
// If the input state change caused this session to end, we should stop // If the input state change caused this session to end, we should stop
...@@ -460,7 +462,7 @@ void XRFrameProvider::ProcessScheduledFrame( ...@@ -460,7 +462,7 @@ void XRFrameProvider::ProcessScheduledFrame(
if (session->ended()) if (session->ended())
continue; continue;
if (frame_data && frame_data->mojo_space_reset) { if (inline_frame_data && inline_frame_data->mojo_space_reset) {
session->OnMojoSpaceReset(); session->OnMojoSpaceReset();
} }
......
...@@ -88,7 +88,7 @@ class XRFrameProvider final : public GarbageCollected<XRFrameProvider> { ...@@ -88,7 +88,7 @@ class XRFrameProvider final : public GarbageCollected<XRFrameProvider> {
HeapHashMap<Member<XRSession>, HeapHashMap<Member<XRSession>,
mojo::Remote<device::mojom::blink::XRFrameDataProvider>> mojo::Remote<device::mojom::blink::XRFrameDataProvider>>
non_immersive_data_providers_; non_immersive_data_providers_;
HeapHashMap<Member<XRSession>, device::mojom::blink::VRPosePtr> HeapHashMap<Member<XRSession>, device::mojom::blink::XRFrameDataPtr>
requesting_sessions_; requesting_sessions_;
// This frame ID is XR-specific and is used to track when frames arrive at the // This frame ID is XR-specific and is used to track when frames arrive at the
......
...@@ -3141,7 +3141,6 @@ crbug.com/626703 [ Win ] external/wpt/css/css-align/baseline-rules/grid-item-inp ...@@ -3141,7 +3141,6 @@ crbug.com/626703 [ Win ] external/wpt/css/css-align/baseline-rules/grid-item-inp
crbug.com/626703 [ Linux ] external/wpt/css/css-align/baseline-rules/grid-item-input-type-text.html [ Failure ] crbug.com/626703 [ Linux ] external/wpt/css/css-align/baseline-rules/grid-item-input-type-text.html [ Failure ]
crbug.com/626703 [ Mac ] external/wpt/css/css-align/baseline-rules/grid-item-input-type-text.html [ Failure ] crbug.com/626703 [ Mac ] external/wpt/css/css-align/baseline-rules/grid-item-input-type-text.html [ Failure ]
crbug.com/626703 [ Win ] external/wpt/css/css-align/baseline-rules/grid-item-input-type-text.html [ Failure ] crbug.com/626703 [ Win ] external/wpt/css/css-align/baseline-rules/grid-item-input-type-text.html [ Failure ]
crbug.com/626703 external/wpt/webxr/events_referenceSpace_reset_inline.https.html [ Timeout ]
crbug.com/626703 [ Linux ] external/wpt/clear-site-data/storage.https.html [ Timeout ] crbug.com/626703 [ Linux ] external/wpt/clear-site-data/storage.https.html [ Timeout ]
crbug.com/626703 [ Mac ] external/wpt/clear-site-data/storage.https.html [ Timeout ] crbug.com/626703 [ Mac ] external/wpt/clear-site-data/storage.https.html [ Timeout ]
crbug.com/626703 [ Win ] external/wpt/clear-site-data/storage.https.html [ Timeout ] crbug.com/626703 [ Win ] external/wpt/clear-site-data/storage.https.html [ Timeout ]
......
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