-
Notifications
You must be signed in to change notification settings - Fork 220
Conversation
2a3ee24
to
cafd4b5
Compare
Note: I can't extend GeckoDisplay and PanZoomController. See https://bugzilla.mozilla.org/show_bug.cgi?id=1489933 |
1aca998
to
c26e127
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think overriding GeckoSession and the others is the easiest approach. Ideally we can get the GeckoDisplay & PanZooomController extend fixed in GeckoView. ServoSession code looks good.
We should make using servo compilation optional for now, until it's ready in maven and ready for production / WebVR working.
We can use user.properties file as we do with local GeckoView builds. Check this code for reference:
https://github.com/MozillaReality/FirefoxReality/blob/master/app/build.gradle#L200
Example user.properties file here. We could add something as servoViewLocal.
geckoViewLocal=/Users/mortimer/Projects/geckoLocal/geckoview.aar
When servoViewLocal is not defined we should not include the toggle in dev settings and inject the bridge classes. Probably the best way would be to move the classes to servoview gradle project in FxR which could only compiled if geckoview.aar exists. We could use reflection instead new ServoSession
so that part doesn't fail to compile when servo dependency is not available or disabled.
bc47c48
to
7d74382
Compare
Can we make Servo support non optional? The AAR would be pulled from download.servo.org. Or at least make sure the CI builds and test Servo support? If we don't build Servo automatically, I'm afraid Servo support will break every other day. |
is Maven deploy possible? It would make things a bit easier because that way it handles the cache and we can set a stable version, instead of pulling always the latest version from download.servo.org |
Yes. I'll see if we can use is maven.m.o or if we should setup something under servo.org. |
24bdecf
to
fa1f324
Compare
fa1f324
to
dc9d7a2
Compare
dc9d7a2
to
41a3809
Compare
41a3809
to
d1edfbc
Compare
@MortimerGoro this is ready for review but not 100% ready to land. Waiting on the 2 bugs mentioned above. But I would appreciate an early review. |
|
||
@Override | ||
public void surfaceDestroyed() { | ||
mServoSession = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on GeckoView surfaceDestroyed
pauses the compositor internally. We should so something similar in Servo. It's used to pause the compositor while in WebVR, or also when the activity goes to background.
@@ -40,6 +40,13 @@ | |||
android:layout_marginStart="10dp" | |||
android:src="@drawable/ic_icon_home" /> | |||
|
|||
<org.mozilla.vrbrowser.ui.UIButton |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is for testing right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, we want this to land. It only shows when the pref is on.
We will think of a better UI later I guess.
There are still some TODOs (e.g. handle all the kind of motion events correctly, pausing the compositor, ...) but code looks good on a high level |
For the TODO in the panzoom controller, I was thinking about doing that in a follow-up PR. |
d1edfbc
to
4433afe
Compare
@MortimerGoro I filed follow-up issues for all the FIXME. Once this lands, I will also file a follow-up for the mouse events. There are only 2 "FIXME BEFORE LANDING" left that I will fix once the maven repo is published. Can I get a formal review? |
Before landing, we need to:
|
http://servo-builds.s3.amazonaws.com/nightly/maven/org/mozilla/servoview/servoview-armv7/maven-metadata.xml now exists and will be updated as part of the nightly build. |
8382b44
to
5c68f89
Compare
Maven repo is available and GV has been updated. This is ready to land. |
5c68f89
to
58c0d96
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been testing this and we can create automated builds but I don't think it's ready for production release flavors:
- The APK size goes from ~60MB to ~105MB. Google Play Store has a limit of 100MB per APK. This is going to block some store uploads. We'd need to split the libraries and implement expansion files https://developer.android.com/google/play/expansion-files#Downloading in order to be able to publish APKs on the store. Oculus Store has a bigger limit (500MB I think) but not sure about the other stores.
- Tested some pages such as youtube, sketchfab and they didn't work. After loading sketchfab I couldn't navigate to more websites. Are DOM images broken? I can't see them in the home URL or in a google search.
I think the safest thing for now is create a new flavor (e.g oculusvrServo) and include that in the automated builds. I'm thinking on something like this:
- Move all the files in common/shared/org/mozilla/servo to the
servoview-local
gradle module servoview-local
could be renamed toservo
. It may be worth it to create a custom repository for this, in order to separate the Gecko/Servo internal "webview" work from the FxR work. We want to use commit differences between tags for release notes. UsecompileOnly
instead ofimplementation
for the GeckoView dependency, so it's injected by the root project- Create
oculusvrServo
flavor and includeoculusvrServoImplementation project(':servo')
dependency - Use reflection instead of
new ServoSession()
so it works on the flavors which don't include Servo yet. (Remember to add a proguard filter) - oculusvrServo is used by default to generate Servo builds. In addition with a single line change
oculusvrServoImplementation project(':servo')
toimplementation project(':servo')
we can make Servo available on any flavor for local testing or when we decide it's ready to be public on release flavors.
@@ -0,0 +1,36 @@ | |||
package org.mozilla.servo; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move files in common/shared/org/mozilla/servo to a servo module.
@@ -0,0 +1,36 @@ | |||
package org.mozilla.servo; | |||
|
|||
import android.view.Surface; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move files in common/shared/org/mozilla/servo to a servo module.
@@ -0,0 +1,182 @@ | |||
package org.mozilla.servo; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move files in common/shared/org/mozilla/servo to a servo module.
@@ -0,0 +1,227 @@ | |||
package org.mozilla.servo; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move files in common/shared/org/mozilla/servo to a servo module.
if (!aSettings.servo) { | ||
state.mSession = new GeckoSession(); | ||
} else { | ||
state.mSession = new ServoSession(mContext); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use reflection to create the Servo session. Make sure you add a proguard filter so it works with minification enabled too for release builds
@@ -161,6 +163,12 @@ public void onClick(View view) { | |||
mMultiprocessSwitch.setSoundEffectsEnabled(false); | |||
setMultiprocess(SettingsStore.getInstance(getContext()).isMultiprocessEnabled(), false); | |||
|
|||
mServoSwitchText = findViewById(R.id.developer_options_servo_switch_text); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use reflection to detect if Servo is included, and hide the button if it's not included
@MortimerGoro we are going to target the Oculus store for now. We will implement that expansion system later.
We are aware that many websites are broken. We will follow up on these issues after this lands. Our plan is to enable the Servo button only for websites we know work correctly. |
58c0d96
to
7178776
Compare
@MortimerGoro I have addressed your comments. Can you take a look and confirm that this is what you wanted. It's not ready for review because I started getting an "incompatible app" error. I have no idea why. This is unrelated to code change afaict. Still investigating. |
cf0ca4a
to
61f885b
Compare
I finally worked around the "incompatible app" error. This is ready for review. I don't have an Oculus Go device, so please someone give it a try (we might run into an issue where the oculus androidmanifest is not included in the apk). |
servo/build.gradle
Outdated
dependencies { | ||
// To see what the latest servoview version is go here: | ||
// https://download.servo.org/nightly/maven/org/mozilla/servoview/servoview-armv7/maven-metadata.xml | ||
implementation 'org.mozilla.servoview:servoview-armv7:0.0.1.20181005.caa4d190af' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use 0.0.1.20181015.532775 to pull in the latest fixes for oculus.
Looks like our generated maven manifest doesn't contain valid data, so that will have to wait. |
0.0.1.20181015.5327758 should now work. |
@jdm What does 0.0.1.20181015.5327758 fix? |
@MortimerGoro Rendering of images without alpha channels (and many three.js examples), as well as reloading pages containing images. |
I've tried debug and release servo builds, and I get this:
The non-servo builds work fine. |
Oculus right? Pretty sure it's missing manifest. It's not as easy as for googlevr. Looking at it. |
61f885b
to
7ea0b97
Compare
I checked the Oculus APK and indeed the manifest was missing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. One thing missing is the proguard rule for the reflection class. I have not tried but it may fail in release builds without that
7ea0b97
to
b796eed
Compare
I tested with a release build (googlevr) and it works. |
The latest changes work on Oculus. |
b796eed
to
d29da61
Compare
d29da61
to
971d99f
Compare
This is an early PR to support Servo. It toggles from Gecko to Servo when the homebutton is pressed (just as a temporary trigger). It overrides GeckoSession and a few other classes.
I'd like to get an early feedback to know if this approach is sensible.
@MortimerGoro Can I ask you to take a look?