Auto merge of #23576 - asajeffrey:magicleap-fix-servo2d, r=Manishearth

Fixed magicleap Servo2D application

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

Sigh, of course the latest changes for immersive Servo on the ML1 broke the landscape app.

---
<!-- 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 do not require tests because we don't have a way to smoke-test on the ML1

<!-- 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/23576)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-06-15 05:53:19 -04:00 committed by GitHub
commit fd174c54ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -140,17 +140,22 @@ pub unsafe extern "C" fn init_servo(
}; };
info!("got args: {:?}", args); info!("got args: {:?}", args);
let vr_init = if landscape {
VRInitOptions::None
} else {
let name = String::from("Magic Leap VR Display"); let name = String::from("Magic Leap VR Display");
let (service, heartbeat) = let (service, heartbeat) =
MagicLeapVRService::new(name, ctxt, gl.clone()).expect("Failed to create VR service"); MagicLeapVRService::new(name, ctxt, gl.clone()).expect("Failed to create VR service");
let service = Box::new(service); let service = Box::new(service);
let heartbeat = Box::new(heartbeat); let heartbeat = Box::new(heartbeat);
VRInitOptions::VRService(service, heartbeat)
};
let opts = InitOptions { let opts = InitOptions {
args, args,
url: Some(url.to_string()), url: Some(url.to_string()),
density: hidpi, density: hidpi,
enable_subpixel_text_antialiasing: false, enable_subpixel_text_antialiasing: false,
vr_init: VRInitOptions::VRService(service, heartbeat), vr_init,
coordinates, coordinates,
}; };
let wakeup = Box::new(EventLoopWakerInstance); let wakeup = Box::new(EventLoopWakerInstance);