Handle properly WebGL offscreen context in Platform context environment

RESOLVED FIXED in mozilla14

Status

()

Core
Graphics
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: romaxa, Assigned: romaxa)

Tracking

Trunk
mozilla14
ARM
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

5 years ago
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)

Comment 1

5 years ago
Created attachment 605315 [details] [diff] [review]
Bind GLContext backed with thebes surface
Assignee: nobody → romaxa
Status: NEW → ASSIGNED
Attachment #605315 - Flags: review?(jmuizelaar)
(Assignee)

Comment 2

5 years ago
Created attachment 605826 [details] [diff] [review]
Bind GLContext backed with thebes surface, and share Qt context as global

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-
(Assignee)

Comment 4

5 years ago
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.
(Assignee)

Updated

5 years ago
Summary: WebGL offscreen context created with CreateEGLPixmapOffscreenContext not bounded properly → Handle properly WebGL offscreen context in Platform context environment
(Assignee)

Comment 5

5 years ago
Created attachment 608141 [details] [diff] [review]
Handle offscreen GL context in 3rd party 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
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla14
You need to log in before you can comment on or make changes to this bug.