Closed Bug 735164 Opened 9 years ago Closed 9 years ago

Handle properly WebGL offscreen context in Platform context environment

Categories

(Core :: Graphics, defect)

ARM
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla14

People

(Reporter: romaxa, Assigned: romaxa)

Details

Attachments

(1 file, 2 obsolete files)

On attempt to run WebGL in Qt (N9) fennec with browser.tabs.remote = false or b2g Qt build, WebGL rendering does not work.

I see warning "don't know how to bind this!"

We can bind it with sEGLLibrary.fBindTexImage.
Assignee: nobody → romaxa
Status: NEW → ASSIGNED
Attachment #605315 - Flags: review?(jmuizelaar)
Also one change in order to make WebGL context shared to Qt context, and make future rendering via FBO texture possible
Attachment #605315 - Attachment is obsolete: true
Attachment #605826 - Flags: review?(jgilbert)
Attachment #605315 - Flags: review?(jmuizelaar)
Comment on attachment 605826 [details] [diff] [review]
Bind GLContext backed with thebes surface, and share Qt context as global

Review of attachment 605826 [details] [diff] [review]:
-----------------------------------------------------------------

::: gfx/gl/GLContextProviderEGL.cpp
@@ +1405,5 @@
>      }
>  
>      GLContextEGL *offs = static_cast<GLContextEGL*>(aOffscreen);
>  
> +    if ((offs->mIsPBuffer && offs->mPBufferCanBindToTexture) || offs->mThebesSurface) {

We should just switch to using a generic 'mCanBindToTexture', which should be set correctly when we create the context.

@@ +2156,5 @@
>  
>          glContext->SetIsDoubleBuffered(context->format().doubleBuffer());
>  
>          glContext->SetPlatformContext(context);
> +        gGlobalContext = glContext;

What's the purpose of this change? We should only be using GetGlobalContext() to implicitly create the global context.
Attachment #605826 - Flags: review?(jgilbert) → review-
In Qt toolkit case we have context created by Qt... and that created before gecko even initialized. and basically we need to share all offscreen's with that context.
So this patch marking that Qt GL context as shared Global for everything else.
Summary: WebGL offscreen context created with CreateEGLPixmapOffscreenContext not bounded properly → Handle properly WebGL offscreen context in Platform context environment
1) mPBufferCanBindToTexture -> mCanBindToTexture
2) Mark 3rd party platform GL context as global shared context.
3) Notify Platform context about context switch.
4) Mark EGLPixmapOffscreen context bindable to texture
Attachment #605826 - Attachment is obsolete: true
Attachment #608141 - Flags: review?(jgilbert)
Comment on attachment 608141 [details] [diff] [review]
Handle offscreen GL context in 3rd party platform context environment

Review of attachment 608141 [details] [diff] [review]:
-----------------------------------------------------------------

Awesome. Looks nice and surgical.
Attachment #608141 - Flags: review?(jgilbert) → review+
https://hg.mozilla.org/mozilla-central/rev/93760138202c
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla14
You need to log in before you can comment on or make changes to this bug.