Closed Bug 1380843 Opened 7 years ago Closed 7 years ago

Add gfx preference so GLScreenBuffer may be toggled between SurfaceFactory_EGLImage and SurfaceFactory_SurfaceTexture

Categories

(Firefox for Android Graveyard :: Toolbar, enhancement, P3)

Unspecified
Android
enhancement

Tracking

(firefox57 fixed)

RESOLVED FIXED
Firefox 57
Tracking Status
firefox57 --- fixed

People

(Reporter: rbarker, Assigned: rbarker)

Details

Attachments

(1 file)

Currently, GLScreenBuffer on Android only uses SurfaceFactory_SurfaceTexture when e10s is enabled. The preference will allow SurfaceFactory_SurfaceTexture to be used even when e10s is not enabled so that it may be tested in Fennec.
Assignee: nobody → rbarker
Comment on attachment 8886416 [details]
Bug 1380843 - Add gfx preference so GLScreenBuffer may be toggled between SurfaceFactory_EGLImage and SurfaceFactory_SurfaceTexture

https://reviewboard.mozilla.org/r/157212/#review163284

::: gfx/gl/GLScreenBuffer.cpp:94
(Diff revision 1)
>                  if (sGLXLibrary.UseTextureFromPixmap())
>                    factory = SurfaceFactory_GLXDrawable::Create(gl, caps, ipcChannel, flags);
>  #elif defined(MOZ_WIDGET_UIKIT)
>                  factory = MakeUnique<SurfaceFactory_GLTexture>(mGLContext, caps, ipcChannel, mFlags);
>  #elif defined(MOZ_WIDGET_ANDROID)
> -                if (XRE_IsParentProcess()) {
> +                if (XRE_IsParentProcess() && !gfxPrefs::WebGLSurfaceTextureEnabled()) {

Shouldn't this change to:
if (SurfTexEnabled())
  factory = Fact_SurfTex
else if (IsParentProcess())
  factory = Fact_EGLImage
  
Otherwise enable-surface-texture/WebGLSurfaceTextureEnabled are misleading.

::: gfx/thebes/gfxPrefs.h:729
(Diff revision 1)
>    DECL_GFX_PREF(Live, "webgl.allow-fb-invalidation",           WebGLFBInvalidation, bool, false);
>  
>    DECL_GFX_PREF(Live, "webgl.perf.max-warnings",                    WebGLMaxPerfWarnings, int32_t, 0);
>    DECL_GFX_PREF(Live, "webgl.perf.max-acceptable-fb-status-invals", WebGLMaxAcceptableFBStatusInvals, int32_t, 0);
>  
> +

You added a newline here on accident.
OS: Unspecified → Android
Priority: -- → P3
Flags: needinfo?(rbarker)
Comment on attachment 8886416 [details]
Bug 1380843 - Add gfx preference so GLScreenBuffer may be toggled between SurfaceFactory_EGLImage and SurfaceFactory_SurfaceTexture

https://reviewboard.mozilla.org/r/157212/#review163906

::: gfx/gl/GLScreenBuffer.cpp:94
(Diff revision 1)
>                  if (sGLXLibrary.UseTextureFromPixmap())
>                    factory = SurfaceFactory_GLXDrawable::Create(gl, caps, ipcChannel, flags);
>  #elif defined(MOZ_WIDGET_UIKIT)
>                  factory = MakeUnique<SurfaceFactory_GLTexture>(mGLContext, caps, ipcChannel, mFlags);
>  #elif defined(MOZ_WIDGET_ANDROID)
> -                if (XRE_IsParentProcess()) {
> +                if (XRE_IsParentProcess() && !gfxPrefs::WebGLSurfaceTextureEnabled()) {

Yes, that's exactly what it should be. I'm on PTO right now but will try and update the patch when I get a moment.
(In reply to Jeff Gilbert [:jgilbert] from comment #2)
> Comment on attachment 8886416 [details]
> Bug 1380843 - Add gfx preference so GLScreenBuffer may be toggled between
> SurfaceFactory_EGLImage and SurfaceFactory_SurfaceTexture
> 
> https://reviewboard.mozilla.org/r/157212/#review163284
> 
> ::: gfx/gl/GLScreenBuffer.cpp:94
> (Diff revision 1)
> >                  if (sGLXLibrary.UseTextureFromPixmap())
> >                    factory = SurfaceFactory_GLXDrawable::Create(gl, caps, ipcChannel, flags);
> >  #elif defined(MOZ_WIDGET_UIKIT)
> >                  factory = MakeUnique<SurfaceFactory_GLTexture>(mGLContext, caps, ipcChannel, mFlags);
> >  #elif defined(MOZ_WIDGET_ANDROID)
> > -                if (XRE_IsParentProcess()) {
> > +                if (XRE_IsParentProcess() && !gfxPrefs::WebGLSurfaceTextureEnabled()) {
> 
> Shouldn't this change to:
> if (SurfTexEnabled())
>   factory = Fact_SurfTex
> else if (IsParentProcess())
>   factory = Fact_EGLImage
>   
> Otherwise enable-surface-texture/WebGLSurfaceTextureEnabled are misleading.
> 

Actually, on second thought, I think what I have is correct. For Fennec and non-e10s geckoview we want to run with SurfaceFactory_GLTexture because SurfaceFactory_SurfaceTextures will assert some times when switching tabs. However with e10s geckoview, GLTexture will not work and we have to use SurfaceTextures. That was how it was working. But with WebVR in non-e10s GeckoView I need to use SurfaceTextures as well. So I added the gfxPref so that I could switch it on for that case only. I believe that is what my patch does. Eventually I think we just want to use SurfaceTextures but there are still a few issues that need to be fixed before switching everything over.
Flags: needinfo?(rbarker)
jgilbert, review ping (see comment 4)
Flags: needinfo?(jgilbert)
Comment on attachment 8886416 [details]
Bug 1380843 - Add gfx preference so GLScreenBuffer may be toggled between SurfaceFactory_EGLImage and SurfaceFactory_SurfaceTexture

https://reviewboard.mozilla.org/r/157212/#review168582
Attachment #8886416 - Flags: review?(jgilbert) → review+
Pushed by rbarker@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/2e6dbfb4f07a
Add gfx preference so GLScreenBuffer may be toggled between SurfaceFactory_EGLImage and SurfaceFactory_SurfaceTexture r=jgilbert
https://hg.mozilla.org/mozilla-central/rev/2e6dbfb4f07a
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 57
Flags: needinfo?(jgilbert)
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: