Commit 432c7174 authored by Bill Orr's avatar Bill Orr Committed by Commit Bot

Revert "WebVR: Update VRDisplay.GetFrameData to follow the current spec."

This reverts commit 14020f57.

Reason for revert: Hold off on API breaking change till M62, so we can have several that go out at the same time and we'll have a new origin trial.

Original change's description:
> WebVR: Update VRDisplay.GetFrameData to follow the current spec.
> 
> The WebVR 1.1 spec was updated to clarify the behavior of getFrameData.
> Now, GetFrameData should return false unless called within a
> VRDisplay.requestAnimationFrame callback.
> 
> BUG=736023
> 
> Change-Id: I14d9442a016817a78232ed7b1e71956c8dac614a
> Reviewed-on: https://chromium-review.googlesource.com/578188
> Reviewed-by: Brandon Jones <bajones@chromium.org>
> Commit-Queue: Bill Orr <billorr@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#487970}

TBR=bajones@chromium.org,bsheedy@chromium.org,billorr@chromium.org

Change-Id: Ia0491a7af887c6149b69178747f6a0e6a9b5f3d2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 736023
Reviewed-on: https://chromium-review.googlesource.com/580167Reviewed-by: default avatarMichael Thiessen <mthiesse@chromium.org>
Commit-Queue: Michael Thiessen <mthiesse@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488396}
parent 237f8276
<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src="resources/fake-vr-displays.js"></script>
<script src="file:///gen/layout_test_data/mojo/public/js/mojo_bindings.js"></script>
<script src="file:///gen/device/vr/vr_service.mojom.js"></script>
<script src="resources/mock-vr-service.js"></script>
<script src="resources/test-constants.js"></script>
<script>
let fakeDisplays = fakeVRDisplays();
vr_test( (t, mock_service) => {
return navigator.getVRDisplays().then( (displays) => {
var display = displays[0];
var expected_pose = VALID_POSE;
var fd = new VRFrameData();
var counter = 0;
function onFrame() {
window.requestAnimationFrame(onFrame);
if (counter == 0) {
t.step( () => {
assert_false(display.getFrameData(fd));
}, "Expecting to not get framedata since there is no pose");
mock_service.mockVRDisplays_[0].setPose(expected_pose);
t.step( () => {
assert_false(display.getFrameData(fd));
}, "Does not update within the same frame");
} else {
t.step( () => {
assert_false(display.getFrameData(fd));
}, "getFrameData is expected to return false when not in a display RAF callback");
t.done();
}
counter++;
}
window.requestAnimationFrame(onFrame);
}, (err) => {
t.step( () => {
assert_unreached("getVRDisplays rejected");
});
});
}, [fakeDisplays["Pixel"]],
"getFrameData updates on the next frame");
</script>
...@@ -148,17 +148,6 @@ bool VRDisplay::getFrameData(VRFrameData* frame_data) { ...@@ -148,17 +148,6 @@ bool VRDisplay::getFrameData(VRFrameData* frame_data) {
if (!frame_data) if (!frame_data)
return false; return false;
if (!in_animation_frame_) {
Document* doc = navigator_vr_->GetDocument();
if (doc) {
doc->AddConsoleMessage(
ConsoleMessage::Create(kRenderingMessageSource, kWarningMessageLevel,
"getFrameData must be called within a "
"VRDisplay.requestAnimationFrame callback."));
}
return false;
}
if (depth_near_ == depth_far_) if (depth_near_ == depth_far_)
return false; 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