Draw GeckoView with a shared OpenGL context
Categories
(GeckoView :: General, defect)
Tracking
(Not tracked)
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).
Updated•7 years ago
|
| Reporter | ||
Comment 1•7 years ago
|
||
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?
Comment 2•7 years ago
|
||
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.
Comment 3•7 years ago
|
||
@ 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:
| Reporter | ||
Comment 4•7 years ago
|
||
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
Comment 5•7 years ago
|
||
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.
Description
•