Closed Bug 1518306 Opened 7 years ago Closed 7 years ago

Draw GeckoView with a shared OpenGL context

Categories

(GeckoView :: General, defect)

60 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: iansphilips, Unassigned)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:64.0) Gecko/20100101 Firefox/64.0

Steps to reproduce:

I've been searching through the GeckoView plugin source code and I can't figure out where the OpenGL context is managed and/or where drawing occurs. I've successfully switched the GeckoView's SurfaceView to a TextureView and displayed this on the emulator. When I try and port this code to a Unity Plugin (which uses its own OpenGL context) I can't get the GeckoView to continue drawing. I'd love, love, love some advice on this. My project is open source and solving this would help port Firefox as a tool for VR developers (https://github.com/IanPhilips/UnityAndroidVRBrowser).

Product: Firefox for Android → GeckoView

I see the tags @WrapForJNI and signatures like public native but I can't find any native code where I can inspect what is going on. How do I find the native library/code that is used by the GeckoView library?

iansphilips: @WrapForJNI and JNIObject are used in the org.mozilla.gecko.annotationProcessor package, which generates the JNI wrappers file located in objdir/widget/android/GeneratedJNIWrappers.{h,cpp} from there should should be able to figure out where we use our jni hooks in native code.

Hope this helps.

@ Randall, do you have a pointer to any FxR code that would a useful example of using GeckoView with a SurfaceView or TextureView?

@ Ian, if you have more questions, you can send them to the "mobile-firefox-dev" mailing list:

https://mail.mozilla.org/listinfo/mobile-firefox-dev

Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Flags: needinfo?(rbarker)
Resolution: --- → INVALID

Looks like I can't actually use a TextureView (hardware acceleration decreases Unity's performance) , but instead render the geckoview's surface from its standard SurfaceView to a texture. Hopefully I'll get some hints from here

Rather than Using the GeckoView, I would create a Surface from a SurfaceTexture and pass that into a GeckoSession. Then you can use the surface texture as a texture in your scene.

Flags: needinfo?(rbarker)
You need to log in before you can comment on or make changes to this bug.