Canvas redraw doesn't update on screen after made hidden, then visible
Categories
(Core :: Graphics: WebRender, defect, P3)
Tracking
()
People
(Reporter: ori, Assigned: sotaro)
References
(Regression)
Details
(Keywords: regression)
Attachments
(2 files)
Tested on latest Nightly with WebRender enabled.
The attached testcase hides and shows a canvas. Clicking the canvas redraws it.
After the canvas is visible again, the next draw operation(s) is not displayed, as if nothing happens.
Subsequent draw operations after that do appear correctly.
This only happens with WebRender enabled, and with a canvas element (e.g. doing the same thing with a div works correctly).
Hiding and showing the canvas in the testcase is done by setting the "visibility" property, but the same happens by changing the "display" property, or using other tricks such as calling "replaceWith()".
Comment 1•6 years ago
|
||
Debian Testing, KDE, X11
mozregression --good 2018-01-15 --bad 2018-06-15 --pref gfx.webrender.all:true browser.tabs.drawInTitlebar:true browser.startup.homepage:'https://bug1569724.bmoattachments.org/attachment.cgi?id=9081359'
4:29.76 INFO: Last good revision: 4d5c3fa215602dd850bf4a994e19afc2065d74b7 (2018-02-12)
4:29.76 INFO: First bad revision: e43f2f6ea111c2d059d95fa9a71516b869a69698 (2018-02-13)
4:29.76 INFO: Pushlog:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=4d5c3fa215602dd850bf4a994e19afc2065d74b7&tochange=e43f2f6ea111c2d059d95fa9a71516b869a696985:04.51 INFO: There are no build artifacts on inbound for these changesets (they are probably too old).
| Reporter | ||
Comment 2•6 years ago
|
||
In the regression range, a likely culprit may be bug 1237454: "Optimize animations in visibility:hidden elements".
Comment 3•6 years ago
|
||
Hiro, can you take a look to see if Bug 1237454 might have an impact here?
Comment 4•6 years ago
|
||
Yeah, I will take a look of course, but I don't think bug 1237454 caused this because it affects only animations. The issue looks like more hit-testing issue (on WebRender), so this commit maybe?
Comment 5•6 years ago
|
||
Jeff - I see you were the reviewer for the commit Hiro linked to above, not sure if that might be related somehow?
Comment 6•6 years ago
|
||
Confirmed that the revision right before bug 1436058 doesn't have the issue and the last commit of bug 1436058 has the issue.
Updated•6 years ago
|
| Assignee | ||
Comment 7•6 years ago
|
||
(In reply to Hiroyuki Ikezoe (:hiro) from comment #6)
and the last commit of bug 1436058 has the issue.
The patch was originally reviewed at Bug 1432708
| Assignee | ||
Comment 8•6 years ago
|
||
I want to take a bug.
| Assignee | ||
Comment 9•6 years ago
•
|
||
(In reply to Hiroyuki Ikezoe (:hiro) from comment #6)
Confirmed that the revision right before bug 1436058 doesn't have the issue and the last commit of bug 1436058 has the issue.
The above was related to a root cause. AsyncImagePipelineManager::UpdateImageKeys() requests to use different TextureHost for updating rendering. And PersistentBufferProviderShared does not work well with AsyncImagePipelineManager and WR in the user case.
| Assignee | ||
Comment 10•6 years ago
|
||
When TextureClient is managed by PersistentBufferProviderShared, AsyncImagePipelineManager expects that read lock of TextureHost is locked during rendering. Read lock prevents that TextureClient is reused during rendering. But when the problem happened, the read lock was not held.
When the canvas became hidden, WebRenderCanvasRendererAsync was destroyed and then the read lock of TextureHost was released. When the canvas became visible again, WebRenderCanvasRendererAsync was re-created and the previous TextureClient/TextureHost was rendered as initial content. But its read lock was not held. At a next canvas update, the same TextureClient wa used for canvas rendering, since it was not read locked. It broke AsyncImagePipelineManager's assumption.
| Assignee | ||
Comment 11•6 years ago
|
||
Comment 12•6 years ago
|
||
Updated•6 years ago
|
| Assignee | ||
Comment 13•6 years ago
|
||
The problem does not happen on Windows. PersistentBufferProviderShared is not used when compositor supports texture direct mapping. See PersistentBufferProviderShared::Create().
https://searchfox.org/mozilla-central/source/gfx/layers/PersistentBufferProvider.cpp#106
Comment 14•6 years ago
|
||
| bugherder | ||
Comment 15•6 years ago
|
||
Is this something we should consider uplifting to Beta for Fx69 or can this ride with Fx70 to release?
| Assignee | ||
Comment 16•6 years ago
|
||
The problem does not happen on Windows, then we could stay on Fx70.
Updated•6 years ago
|
Updated•6 years ago
|
Comment 17•6 years ago
|
||
I have managed to reproduce the reproduce the issue using Fx 70.0a1 (2019-07-22), I can confirm that the issue is fixed on Fx 70.0b12.
Description
•