Auto merge of #22953 - asajeffrey:webvr-glwindow, r=paulrouget

Use a test VRDisplay that renders to a GL window

<!-- Please describe your changes on the following line: -->

Add a `dom.webvr.test` pref that registers a new VR display, which registers to a GL window.

The matching webvr PR is https://github.com/servo/rust-webvr/pull/66.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #22795
- [X] These changes do not require tests because we need a followup PR to support reftests which use the VR display

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22953)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-03-05 15:02:24 -05:00 committed by GitHub
commit 55347aa39f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 95 additions and 13 deletions

View file

@ -258,10 +258,11 @@ where
// can't defer it after `create_constellation` has started.
script::init();
let mut webvr_heartbeats = Vec::new();
let webvr_services = if PREFS.is_webvr_enabled() {
let mut services = VRServiceManager::new();
services.register_defaults();
window.register_vr_services(&mut services);
window.register_vr_services(&mut services, &mut webvr_heartbeats);
Some(services)
} else {
None
@ -308,6 +309,7 @@ where
webrender,
webrender_document,
webrender_api,
webvr_heartbeats,
},
);