Closed Bug 1769399 Opened 4 years ago Closed 4 years ago

animation freeze after switch tab

Categories

(Core :: Graphics: CanvasWebGL, defect)

Firefox 102
defect

Tracking

()

RESOLVED DUPLICATE of bug 1769348

People

(Reporter: mix5003, Unassigned)

Details

Attachments

(1 file)

Attached video 20220515_111401.mp4

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0

Steps to reproduce:

  1. open google.com
  2. open https://mahjongsoul.game.yo-star.com/ and wait until login button appear. you can see the sakura animation play normally
  3. switch to google tab
  4. switch back to mahjong soul tab. you can see that animation already freeze (it pause until window resize)

Actual results:

animation freeze until you resize tab will re-render.
other function works normally for example when animation freeze when you click English at buttom, it still freeze but if you open dev tools or resize windows you can see that it show change language modal

Expected results:

animation should run normally after switch tab back

from mozregression

2022-05-15T11:05:10.586000: DEBUG : Found commit message:
Bug 1763503 - Hold layers::CanvasRenderer in ClientWebGLContext::mNotLost r=jgilbert,gfx-reviewers

bug 1733732 decreased the size of the display port on Android. When you scroll to the bottom of the page, the canvas leaves the display port. It triggers to destroy WebRenderCanvasData and WebRenderCanvasRendererAsync. And then RenderAndroidSurfaceTextureHost::NotifyNotUsed() is called and RenderAndroidSurfaceTextureHost is destroyed.

Then if scrolling makes the canvas into the display port again, WebRenderCanvasData, WebRenderCanvasRendererAsync and RenderAndroidSurfaceTextureHost are recreated again. But there is no rendering update at SharedSurface_SurfaceTexture. Since the page does WebGL rendering only once during page load.

It caused the problem to RenderAndroidSurfaceTextureHost. RenderAndroidSurfaceTextureHost::NotifyNotUsed() returns SurfaceTexture's buffer to client side. For using SurfaceTexture again in RenderAndroidSurfaceTextureHost, Client side needs to do re-rendering to SurfaceTexture. But SharedSurface_SurfaceTexture did nothing in this case.

To address the problem, we could hold layers::CanvasRenderer in ClientWebGLContext::mNotLost. If WebRenderCanvasRendererAsync is kept alive, RenderAndroidSurfaceTextureHost::NotifyNotUsed() and destruction of WebRenderCanvasRendererAsync do not happen.

Then if WebRenderCanvasData is re-created, the stored WebRenderCanvasRendererAsync is set in the new WebRenderCanvasData in ClientWebGLContext::UpdateWebRenderCanvasData().

Differential Revision: https://phabricator.services.mozilla.com/D143811

2022-05-15T11:05:10.586000: DEBUG : Did not find a branch, checking all integration branches
2022-05-15T11:05:10.593000: INFO : The bisection is done.
2022-05-15T11:05:10.876000: INFO : Stopped

The Bugbug bot thinks this bug should belong to the 'Firefox::Tabbed Browser' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Tabbed Browser
Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Component: Tabbed Browser → Canvas: WebGL
Product: Firefox → Core
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: