servo: Runtime problems on Android

Now that the build works, you can run Servo on Android again after applying these patches:

When you start Servo on Android, it produces a gray screen. This is because a missing WindowProxy implementation on Android.

On any input event, the gray screen disappears, and Servo itself starts. At the moment, however, this results in a mostly white screen, with one or two elements visible occasionally. There are no errors, the main loop is running, and I don’t really see anything particularly interesting in the logs either. Also some sites may throw shader compiler errors too.

Here’s a screenshot of https://www.google.com, there, we only have a scrollbar, the menu button and the login button’s text:

screen

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 23 (23 by maintainers)

Commits related to this issue

Most upvoted comments

Hello,

The MozVR team wants a full working Servo Android browser 😃 I have been debugging some of the issues on Android. This is the current status:

  • I have implemented the missing WindowProxy on Android. Now input events are not required to see anything on screen or to run requestAnimationFrame/timers. PR submitted to android-rs-glue upstream https://github.com/tomaka/android-rs-glue/pull/127 Will submit additional PRs to servo glutin and @mmatyas’ android-rs-injected-glue fork when the upstream one is merged.
  • WebGL canvas creation was crashing on Nexus 4 and Google Pixel. This PR fixes these problems: https://github.com/emilio/rust-offscreen-rendering-context/pull/83
  • Servo for Android shows a white/black screen most of the times, even with simple pages like a WebGL triangle or a html with plain images. I’ve done some deeper debugging to hunt down this problem because as @mmatyas said the logs didn’t show anything particularly interesting and there were no errors. There seems to be a issue with the alpha clipping on Android, opened this issue with more detailed info of the problem: https://github.com/servo/webrender/issues/907. We can bypass this error just setting a fixed alpha to 1.0. We can see the WebGL Triangle on the Google Pixel doing that 😃

triangle

  • I’m working on fixing additional problems like a crash while changing device orientation or when the app goes to background.

  • I think that we should upgrade the current built system (ant) to gradle. We’ll need to add some .aar or gradle dependencies and ant is very old do to that kind of things. Another benefit of using gradle is that we can open the project with Android Studio and run the brand new GPU debugger on any Android phone. I’d like to submit a PR including gradle support. Using the gradle wrapper the gradle build system is automatically downloaded on both linux and windows machines. We should move to a newer android-target too, that probably will require running android tools update on build machines. @larsbergstrom what do you think about moving to gradle? Would you like that I work on a PR?

Just wanted to say that this is awesome @MortimerGoro, thanks for looking into this 😃

None at all. The best I’ve got is github.com, where the background image and two button rectangles load correctly.