Bug 1842735 Comment 10 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Liwe Pan from comment #9)
> (In reply to Sotaro Ikeda [:sotaro] from comment #8)
> > Other web sites normally does not have the problem of using video both with WebRender and WebGL, web site also seemed to have a problem.
> 
> Hi sotaro, 
>   Some questions:
> 1. "web site also seemed to have a problem." 
>   I can play the same video in firefox Desktop version(Win/Linux) .  Why this issue only happen in Android version?

Win and Linux, video data could be consumed by both WebGL(upload to WebGL texture) and WebRender(compositing). Android SurfaceTexture has a limitation that it is consumed by only one GL context. Then if video data is consumed by both WebGL and WebRender(compositing), only one of either could consume the video data. The limitation could be removed by using AImageReader and AHardwareBuffer (Bug 1649110).

> 2. "video was used both with WebRender and WebGL" 
>   Could you describe this more?

There were cases that video data is used for rendering at WebRender(upload to WebGL texture)  and WebGL(compositing). WebRender and WebGL exist in different threads(RenderThread and CanvasRenderThread) and use different GL contexts.

- [RenderAndroidSurfaceTextureHost::Lock()](https://searchfox.org/mozilla-central/rev/dcf50463d3e1e1f3a91bc1406e3772b2a5f62774/gfx/webrender_bindings/RenderAndroidSurfaceTextureHost.cpp#46) is used for WebRender rendering.

- [GLBlitHelper::Blit()](https://searchfox.org/mozilla-central/rev/dcf50463d3e1e1f3a91bc1406e3772b2a5f62774/gfx/webrender_bindings/RenderAndroidSurfaceTextureHost.cpp#46) is used for uploading video data to WebGL texture.

WebGL architexture is like the following.
- https://github.com/sotaroikeda/firefox-diagrams/blob/master/dom/dom_canvas_WebGL_111.pdf
(In reply to Liwe Pan from comment #9)
> (In reply to Sotaro Ikeda [:sotaro] from comment #8)
> > Other web sites normally does not have the problem of using video both with WebRender and WebGL, web site also seemed to have a problem.
> 
> Hi sotaro, 
>   Some questions:
> 1. "web site also seemed to have a problem." 
>   I can play the same video in firefox Desktop version(Win/Linux) .  Why this issue only happen in Android version?

Win and Linux, video data could be consumed by both WebGL(upload to WebGL texture) and WebRender(compositing). Android SurfaceTexture has a limitation that it is consumed by only one GL context. Then if video data is consumed by both WebGL and WebRender(compositing), only one of either could consume the video data. The limitation could be removed by using AImageReader and AHardwareBuffer (Bug 1649110).

> 2. "video was used both with WebRender and WebGL" 
>   Could you describe this more?

There were cases that video data is used for rendering at WebRender(upload to WebGL texture)  and WebGL(compositing). WebRender and WebGL exist in different threads(RenderThread and CanvasRenderThread) and use different GL contexts.

- [RenderAndroidSurfaceTextureHost::Lock()](https://searchfox.org/mozilla-central/rev/dcf50463d3e1e1f3a91bc1406e3772b2a5f62774/gfx/webrender_bindings/RenderAndroidSurfaceTextureHost.cpp#46) is used for WebRender rendering.

- [GLBlitHelper::Blit()](https://searchfox.org/mozilla-central/rev/dcf50463d3e1e1f3a91bc1406e3772b2a5f62774/gfx/webrender_bindings/RenderAndroidSurfaceTextureHost.cpp#46) is used for uploading video data to WebGL texture.

Normally, when video data is consumed by WebGL, the video data is presented only via WebGL.

WebGL architexture is like the following.
- https://github.com/sotaroikeda/firefox-diagrams/blob/master/dom/dom_canvas_WebGL_111.pdf

Back to Bug 1842735 Comment 10