Setting canvas.filter="hue-rotate(0deg)" causes incorrect rendering of subsequent draws when the canvas filter is set to a non-zero hue-rotation.
Categories
(Core :: Graphics: Canvas2D, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox-esr115 | --- | unaffected |
| firefox-esr140 | --- | unaffected |
| firefox-esr153 | --- | fixed |
| firefox156 | --- | wontfix |
| firefox157 | --- | wontfix |
| firefox158 | --- | fixed |
| firefox159 | --- | fixed |
People
(Reporter: tcathcartburn, Assigned: lsalzman)
References
(Regression)
Details
(Keywords: nightly-community, regression)
Attachments
(1 file, 3 external files)
|
946 bytes,
text/html
|
Details |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:156.0) Gecko/20100101 Firefox/156.0
Steps to reproduce:
View the attached file. It runs the same rendering code on 2 canvases (drawing a horizontal rectangle, then setting the filter to "hue-rotate(45deg)", then drawing a vertical rectangle and a png). The left canvas first has the filter set to "hue-rotate(0deg)" which should be equivalent to having no filter set.
Actual results:
The renderings look different. Exact behavior varies across Firefox versions - for my current version of Firefox, the vertical rectangle is not drawn on the left canvas and the image is drawn with something close to a hue-rotate by the negation of the specified angle. In other versions of Firefox with the bug, the vertical rectangle exhibits some transparency, is drawn partially, and/or behaves nondeterministically, changing between refreshes of the page.
Expected results:
The two canvases should be rendered identically.
| Reporter | ||
Comment 1•2 months ago
|
||
If the code is stepped through in the javascript debugger, the bug does not manifest. If the canvas is any smaller than 128x128, the bug does not manifest
The bug first appears with https://phabricator.services.mozilla.com/D267531; my further investigation is based on the repository at that point in time.
In /gfx/src/FilterSupport.cpp, if the return value mozilla::gfx::ComputeColorMatrix (which indicates whether it has computed the identity matrix) is ignored, removing the conditional check for early return, then the bug goes away. However, this feels like the wrong fix, since it removes the useful optimization of doing less work when a filter shouldn't have any effect.
Updated•2 months ago
|
Updated•2 months ago
|
Comment 2•2 months ago
|
||
:lsalzman, since you are the author of the regressor, bug 1947364, could you take a look? Also, could you set the severity field?
For more information, please visit BugBot documentation.
Updated•2 months ago
|
| Assignee | ||
Updated•2 months ago
|
| Assignee | ||
Comment 3•2 months ago
|
||
When an identity color matrix is supplied, this may generate a filter sequence of premul-crop-unpremul
instead of the expected premul-crop-colormatrix-unpremul. This caused a fallback to a software filter
that failed to read back from an A8 accelerated textures.
This fixes the A8 readback to work and plumbs the necessary pathway through FilterNodeWebgl::Draw to
avoid the fallback.
Updated•2 months ago
|
Comment 4•2 months ago
|
||
Set release status flags based on info from the regressing bug 1947364
Updated•2 months ago
|
Comment 6•2 months ago
|
||
Set release status flags based on info from the regressing bug 1947364
Comment 7•2 months ago
|
||
| bugherder | ||
Comment 8•2 months ago
|
||
The patch landed in nightly and beta is affected, along with ESR.
:lsalzman, please make an uplift decision for each affected release:
- For beta, nominate the patch for beta uplift approval if the fix should be included in this release, or set
status-firefox158towontfixif the fix can wait for the next release. - For ESR, nominate the patch for the appropriate ESR uplift approval if the fix should be included in ESR, or set the ESR status flag(s) to
wontfixif an uplift isn't needed. Each affected ESR release needs a decision.
See Requesting an Uplift for documentation on how to request an uplift.
For more information, please visit BugBot documentation.
| Assignee | ||
Updated•2 months ago
|
| Assignee | ||
Comment 9•2 months ago
|
||
When an identity color matrix is supplied, this may generate a filter sequence of premul-crop-unpremul
instead of the expected premul-crop-colormatrix-unpremul. This caused a fallback to a software filter
that failed to read back from an A8 accelerated textures.
This fixes the A8 readback to work and plumbs the necessary pathway through FilterNodeWebgl::Draw to
avoid the fallback.
Original Revision: https://phabricator.services.mozilla.com/D328744
Updated•2 months ago
|
Comment 10•2 months ago
|
||
firefox-beta Uplift Approval Request
- User impact if declined/Reason for urgency: Incorrect rendering of filters with accelerated canvas
- Code covered by automated testing?: yes
- Fix verified in Nightly?: yes
- Needs manual QE testing?: no
- Steps to reproduce for manual QE testing:
- Risk associated with taking this patch: low
- Explanation of risk level: Fixes handling of certain filter combinations
- String changes made/needed?: None
- Is Android affected?: yes
Comment 11•2 months ago
|
||
firefox-esr153 Uplift Approval Request
- User impact if declined/Reason for urgency: Incorrect rendering of filters with accelerated canvas
- Code covered by automated testing?: yes
- Fix verified in Nightly?: yes
- Needs manual QE testing?: no
- Steps to reproduce for manual QE testing:
- Risk associated with taking this patch: low
- Explanation of risk level: Fixes handling of certain filter combinations
- String changes made/needed?: None
- Is Android affected?: yes
| Assignee | ||
Comment 12•2 months ago
|
||
When an identity color matrix is supplied, this may generate a filter sequence of premul-crop-unpremul
instead of the expected premul-crop-colormatrix-unpremul. This caused a fallback to a software filter
that failed to read back from an A8 accelerated textures.
This fixes the A8 readback to work and plumbs the necessary pathway through FilterNodeWebgl::Draw to
avoid the fallback.
Original Revision: https://phabricator.services.mozilla.com/D328744
Updated•2 months ago
|
Updated•2 months ago
|
Comment 13•2 months ago
|
||
| uplift | ||
Updated•1 month ago
|
Updated•1 month ago
|
Comment 14•1 month ago
|
||
| uplift | ||
Updated•1 month ago
|
Description
•