Canvas testcase changes when tabbing away and back in Firefox, but not in Chrome or Safari (GPU-Canvas + OffscreenCanvas issue)
Categories
(Core :: Graphics: Canvas2D, defect, P3)
Tracking
()
People
(Reporter: twisniewski, Assigned: aosmond)
References
(Blocks 2 open bugs, Regressed 1 open bug)
Details
(Keywords: regression)
Attachments
(2 files)
591 bytes,
text/html
|
Details | |
48 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-esr115+
|
Details | Review |
In the attached testcase, the red square in the red square in the blue circle vanishes when I tab away from the testcase and return. I've only tested this on my 2018 Macbook with HWA on (with acceleration off, the red square is not gone upon tabbing back).
Comment 1•11 months ago
•
|
||
Can repro on Wndows Nightly.
Only repros with gpu-canvas enabled.
Till December2011, the red box wouldnt even draw (only the blue circle would be visible). SO looks like parts of this testcase were not fully supported by gpu-canvas from the initial patches.
Updated•11 months ago
|
Comment 2•11 months ago
|
||
Bug 1746110 was the first time when the red box would even draw on the screen.
Updated•11 months ago
|
Updated•11 months ago
|
Comment 3•11 months ago
|
||
This bug has been marked as a regression. Setting status flag for Nightly to affected
.
Comment 4•11 months ago
|
||
:lsalzman Hello, just wanted to see if this was a planned fix for Fx 116?
Comment 5•11 months ago
|
||
Hi :bhood! Adding you to the NI since I saw you triaged this bug. Just a reminder that soft code freeze for 116 is today.
Comment 6•11 months ago
|
||
This is offscreen canvas, so not really P2 IMO. I've been on PTO, so there isn't really time to address any fix for 116.
Updated•11 months ago
|
Comment 7•11 months ago
•
|
||
After discussion with Andrew, it seems like we're not calling OffscreenCanvas::UpdateDisplayData from a paint here: https://searchfox.org/mozilla-central/source/layout/generic/nsHTMLCanvasFrame.cpp#126
WebRenderImageHost clears it TextureHost on tabbing away, but it never gets re-established on tabbing back because of the above.
We do an analogous thing calling ShareableCanvasRender::UpdateCompositable client here which makes the non-offscreen case work: https://searchfox.org/mozilla-central/source/layout/generic/nsHTMLCanvasFrame.cpp#154
Andrew believes the fix is quite involved due to threading/worker issues not allowing us to directly access OffscreenCanvas from there. However, he is best equipped to write the proper fix for this, so I am going to pass this bug over to him.
Updated•10 months ago
|
Assignee | ||
Updated•10 months ago
|
Assignee | ||
Comment 8•10 months ago
|
||
When we recreate the display list, e.g. after tabbing away, we need to
ensure we flush the OffscreenCanvas because our resource handles will be
invalidated. This requires the OffscreenCanvasDisplayHelper to know
which OffscreenCanvas it belongs to, and a worker reference if necessary
to do the dispatching for the flush. Otherwise we would require the
canvas to be updated manually by the web application to repaint.
Pushed by aosmond@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a23f7c7cfe46 Ensure we flush OffscreenCanvas when the display list is recreated. r=lsalzman
Comment 10•10 months ago
|
||
bugherder |
Comment 11•10 months ago
|
||
The patch landed in nightly and beta is affected.
:aosmond, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- If no, please set
status-firefox116
towontfix
.
For more information, please visit BugBot documentation.
Assignee | ||
Comment 12•10 months ago
|
||
One week out from release, not worth uplifting.
Updated•10 months ago
|
Updated•9 months ago
|
Comment 13•9 months ago
•
|
||
Reproducible on a 2023-07-22 Nightly build on macOS 12.
Verified as fixed on Firefox 117.0b3(build ID: 20230803180221) and Nightly 118.0a1(build ID: 20230803214045) on macOS 12, Windows 10, Ubuntu 22.
Assignee | ||
Comment 15•8 months ago
|
||
Comment on attachment 9345262 [details]
Bug 1837070 - Ensure we flush OffscreenCanvas when the display list is recreated.
ESR Uplift Approval Request
- If this is not a sec:{high,crit} bug, please state case for ESR consideration: Missing content when tabbing away from a page with an OffscreenCanvas and returning, as well as painting issues when combining an OffscreenCanvas with CSS changes such as filters
- User impact if declined: Some websites might not display all the content with OffscreenCanvas in certain contexts
- Fix Landed on Version: 117
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Not risky, the change is well understood and has already shipped to release
Comment 16•8 months ago
|
||
Comment on attachment 9345262 [details]
Bug 1837070 - Ensure we flush OffscreenCanvas when the display list is recreated.
Approved for 115.3esr
Comment 17•8 months ago
|
||
uplift |
https://hg.mozilla.org/releases/mozilla-esr115/rev/dc5758d229e6
Updated•8 months ago
|
Comment 18•8 months ago
|
||
Reproducible on a 2023-07-22 Nightly build on macOS 12.
Verified as fixed on Firefox ESR 115.3.0(build ID: 20230918121054) on macOS 12, Windows 10, Ubuntu 22.
Description
•