Closed Bug 2094571 Opened 5 days ago Closed 2 days ago

Incorrect canvas filter drawing (red and blue swapped?) with drawImage on an accelerated 2D canvas

Categories

(Core :: Graphics: Canvas2D, defect)

defect

Tracking

()

RESOLVED FIXED
163 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr153 162+ affected
firefox160 --- wontfix
firefox161 --- wontfix
firefox162 + fixed
firefox163 + fixed

People

(Reporter: mstange, Assigned: lsalzman)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file, 3 external files)

Attached file testcase.html —

Steps to reproduce:

  1. Load the attached testcase.

Expected results: All squares should be green.
Actual results: At least on macOS, two of the 512x512 squares are orange.


Notes:

  • Accelerated canvas filters were added in bug 1947364. Bug 2074107 reported a similar symptom: an image looked hue-rotated by the negated angle. Its fix covered only the identity color matrix (hue-rotate(0deg)), and the bug described here still reproduces with that fix applied.
  • The R/B swaps in bug 2087301 and bug 2089043 are a different problem. They come from the Linux DMABuf import path.

Set release status flags based on info from the regressing bug 1947364

: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.

Flags: needinfo?(lsalzman)

Set release status flags based on info from the regressing bug 1947364

The accelerated filter shader needs to map BGRA colors to BGRA colors. However,
the user-supplied color matrix maps RGBA to RGBA. The matrix supplied to the
shader must be transformed to swap rows 1 and 3 as well as columns 1 and 3 to
ensure colors are swizzled on input to the matrix and on output from the matrix.

Assignee: nobody → lsalzman
Status: NEW → ASSIGNED

I am going to upgrade the severity of this to S2 since this may effect the rendering of any canvas filter on all platforms. As such, I am putting some versions in the tracking back at affected, as I think this warrants uplifts.

Severity: -- → S2
Flags: needinfo?(lsalzman)
OS: Unspecified → All
Hardware: Unspecified → All
Pushed by lsalzman@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/2c860cff1d25 https://hg.mozilla.org/integration/autoland/rev/254865aba31f Ensure accelerated filter color matrix maps BGRA to BGRA. r=gfx-reviewers,tnikkel
Status: ASSIGNED → RESOLVED
Closed: 2 days ago
Resolution: --- → FIXED
Target Milestone: --- → 163 Branch

The patch landed in nightly and beta is affected, along with ESR.

:lsalzman, please make an uplift decision for beta and ESR:

  • For beta, nominate the patch for beta uplift approval if the fix should be included in this release, or set status-firefox162 to wontfix if 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 wontfix if an uplift isn't needed. Each affected ESR release needs a decision.

Uplift requests can be submitted from Lando: D344982.

See Requesting an Uplift for documentation on how to request an uplift.

For more information, please visit BugBot documentation.

Flags: needinfo?(lsalzman)

firefox-beta Uplift Approval Request

  • User impact if declined/Reason for urgency: Distorted rendering when drawing with filters on accelerated Canvas2D.
  • 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 swizzling of color formats during a matrix calculation. Verified with reporter testcase.
  • String changes made/needed?: None
  • Is Android affected?: yes
Attachment #9688240 - Flags: approval-mozilla-beta?

The accelerated filter shader needs to map BGRA colors to BGRA colors. However,
the user-supplied color matrix maps RGBA to RGBA. The matrix supplied to the
shader must be transformed to swap rows 1 and 3 as well as columns 1 and 3 to
ensure colors are swizzled on input to the matrix and on output from the matrix.

Original Revision: https://phabricator.services.mozilla.com/D344982

The accelerated filter shader needs to map BGRA colors to BGRA colors. However,
the user-supplied color matrix maps RGBA to RGBA. The matrix supplied to the
shader must be transformed to swap rows 1 and 3 as well as columns 1 and 3 to
ensure colors are swizzled on input to the matrix and on output from the matrix.

Attachment #9688244 - Flags: approval-mozilla-esr153?

firefox-esr153 Uplift Approval Request

  • User impact if declined/Reason for urgency: Distorted rendering when drawing with filters on accelerated Canvas2D.
  • 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 swizzling of color formats during a matrix calculation. Verified with reporter testcase.
  • String changes made/needed?: None
  • Is Android affected?: yes

Clearing the uplift needinfo request since an uplift has been requested for all the affected channels.

For more information, please visit BugBot documentation.

Flags: needinfo?(lsalzman)
Attachment #9688240 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: