Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upSupport building for Magic Leap. #21985
Conversation
highfive
commented
Oct 19, 2018
|
Heads up! This PR modifies the following files:
|
highfive
commented
Oct 19, 2018
|
It depends on servo/mozjs#158 and servo/media#158. |
|
Filed #21999 to get servo-media updated. |
| libservo = { path = "../../components/servo" } | ||
| servo-egl = "0.2" | ||
| log = "0.4" | ||
| smallvec = "0.6" |
This comment has been minimized.
This comment has been minimized.
| screen_avail: TypedSize2D::new(500, 500), | ||
| window: (TypedSize2D::new(500, 500), TypedPoint2D::new(0, 0)), | ||
| framebuffer: TypedSize2D::new(500, 500), | ||
| viewport: TypedRect::new(TypedPoint2D::new(0, 0), TypedSize2D::new(500, 500)), |
This comment has been minimized.
This comment has been minimized.
| fn get_coordinates(&self) -> EmbedderCoordinates { | ||
| EmbedderCoordinates { | ||
| hidpi_factor: TypedScale::new(1.0), | ||
| screen: TypedSize2D::new(500, 500), |
This comment has been minimized.
This comment has been minimized.
| Resource::QuirksModeCSS => &include_bytes!("../../../resources/quirks-mode.css")[..], | ||
| Resource::RippyPNG => &include_bytes!("../../../resources/rippy.png")[..], | ||
| Resource::DomainList => &include_bytes!("../../../resources/public_domains.txt")[..], | ||
| Resource::BluetoothBlocklist => &include_bytes!("../../../resources/gatt_blocklist.txt")[..], |
This comment has been minimized.
This comment has been minimized.
jdm
Oct 22, 2018
Member
Is it worth adding a build script to this crate that forces a rebuild if any of these files are modified?
|
|
||
| impl log::Log for MLLogger { | ||
| fn enabled(&self, metadata: &log::Metadata) -> bool { | ||
| metadata.level() <= log::Level::Info |
This comment has been minimized.
This comment has been minimized.
jdm
Oct 22, 2018
Member
Maybe store the level in a constant so the set_max_level call earlier matches?
|
|
||
| // The prism dimensions | ||
| const glm::vec3 Servo2D::getInitialPrismExtents() const { | ||
| return glm::vec3(0.5f, 0.5f, 0.5f); |
This comment has been minimized.
This comment has been minimized.
| lumin::ui::Cursor::SetScale(prism_, 0.03f); | ||
| instanceInitialScenes(); | ||
|
|
||
| // Get the panar resource that holds the EGL context |
This comment has been minimized.
This comment has been minimized.
| EGLSurface surf = plane_->getEGLSurface(); | ||
| EGLDisplay dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY); | ||
| eglMakeCurrent(dpy, surf, surf, ctx); | ||
| glViewport(0, 0, 500, 500); |
This comment has been minimized.
This comment has been minimized.
jdm
Oct 22, 2018
Member
Does this need to match the 500s in libmlservo? Can we pass this value in to Rust?
| int main(int argc, char **argv) | ||
| { | ||
| ML_LOG(Debug, "Servo2D Starting."); | ||
| Servo2D myApp; |
This comment has been minimized.
This comment has been minimized.
jdm
Oct 22, 2018
Member
Does argv contain meaningful values for us? Can we accept a URL on the command line?
| EGLSurface surf = plane_->getEGLSurface(); | ||
| EGLDisplay dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY); | ||
| eglMakeCurrent(dpy, surf, surf, ctx); | ||
| glViewport(0, 0, 500, 500); |
This comment has been minimized.
This comment has been minimized.
|
|
|
I did some fixes, but can't test the C++ code because I'm at home rather than in the office. |
|
Rebased. |
|
Updated |
|
I see that you introduced a new port. Did you consider using the c api of libsimpleservo instead of libmlservo? |
|
@paulrouget yes, originally I was using libsimpleservo but ran into horrible linking problems which went away if I used libservo directly. My suspicion is that the ML is going to be a different enough target from Android that we're going to need a different port at some point anyway. |
|
libsimpleservo can be compiled without any android stuff (it compiles on Desktop for example). It's supposed to be capable of being dynamically loaded like libservo. I'd be interested to know what kind of issues you ran into. I don't want to block this, but maybe later we could look at how to re-use libsimpleservo for ML. |
|
It's been a while, but there was some issue about |
|
|
||
| ## Building the Servo2D application | ||
|
|
||
| From inside the `ports/magicleap/Servo2D` directory: |
This comment has been minimized.
This comment has been minimized.
|
@bors-servo delegate+ |
|
|
|
@bors-servo r=jdm |
|
|
Support building for Magic Leap. <!-- Please describe your changes on the following line: --> This PR gets Servo to build for Magic Leap, and provides a dummy Servo2D 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 it's a port to a new architecture <!-- 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/21985) <!-- Reviewable:end -->
|
|
asajeffrey commentedOct 19, 2018
•
edited by SimonSapin
This PR gets Servo to build for Magic Leap, and provides a dummy Servo2D app.
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is