Last Comment Bug 735164 - Handle properly WebGL offscreen context in Platform context environment
: Handle properly WebGL offscreen context in Platform context environment
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Graphics (show other bugs)
: Trunk
: ARM Linux
: -- normal (vote)
: mozilla14
Assigned To: Oleg Romashin (:romaxa)
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-13 01:29 PDT by Oleg Romashin (:romaxa)
Modified: 2012-03-22 18:06 PDT (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Bind GLContext backed with thebes surface (1.67 KB, patch)
2012-03-13 01:30 PDT, Oleg Romashin (:romaxa)
no flags Details | Diff | Splinter Review
Bind GLContext backed with thebes surface, and share Qt context as global (3.28 KB, patch)
2012-03-14 10:16 PDT, Oleg Romashin (:romaxa)
jgilbert: review-
Details | Diff | Splinter Review
Handle offscreen GL context in 3rd party platform context environment (7.85 KB, patch)
2012-03-21 16:36 PDT, Oleg Romashin (:romaxa)
jgilbert: review+
Details | Diff | Splinter Review

Description Oleg Romashin (:romaxa) 2012-03-13 01:29:28 PDT
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.
Comment 1 Oleg Romashin (:romaxa) 2012-03-13 01:30:32 PDT
Created attachment 605315 [details] [diff] [review]
Bind GLContext backed with thebes surface
Comment 2 Oleg Romashin (:romaxa) 2012-03-14 10:16:11 PDT
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
Comment 3 Jeff Gilbert [:jgilbert] 2012-03-16 15:14:24 PDT
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.
Comment 4 Oleg Romashin (:romaxa) 2012-03-16 16:22:49 PDT
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.
Comment 5 Oleg Romashin (:romaxa) 2012-03-21 16:36:24 PDT
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
Comment 6 Jeff Gilbert [:jgilbert] 2012-03-21 16:44:26 PDT
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.
Comment 7 Marco Bonardo [::mak] 2012-03-22 18:06:41 PDT
https://hg.mozilla.org/mozilla-central/rev/93760138202c

Note You need to log in before you can comment on or make changes to this bug.