Closed Bug 1850727 Opened 1 years ago Closed 1 years ago

Canvas2D lines rasterization bug when using clip

Categories

(Core :: Graphics: Canvas2D, defect)

Firefox 117
defect

Tracking

()

VERIFIED FIXED
119 Branch
Tracking Status
firefox-esr102 --- unaffected
firefox-esr115 --- unaffected
firefox117 --- wontfix
firefox118 --- verified
firefox119 --- verified

People

(Reporter: george.pomas, Assigned: lsalzman)

References

(Regression)

Details

(Keywords: regression)

Attachments

(4 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36

Steps to reproduce:

When I try to render lines using Canvas2D APIs the output contains several artefacts. The code for rendering needs to be very exact, so I've attached HTML with JS code that is needed to reproduce the problem. The bug may be flaky, so it's better to restart Firefox and open this HTML while app is in clean state.
I can reproduce this issue on 117 version (Stable), as well as 118.0b2 (Dev).

Actual results:

Artefacts are present in rendering of lines in Firefox 117 and 118.0b2 (Dev). See "firefox_output.png" in attached archive.

Expected results:

Correct rendering of lines (as in Chrome output in attached files).

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

Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Component: JavaScript Engine → Graphics: Canvas2D

Thanks for the report!

Regressed by:
Bug 1837068 - Support alpha strokes by rendering with AAStroke to a mask render target. r=aosmond

Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: regression
Regressed by: 1837068
Flags: needinfo?(lsalzman)

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

Severity: -- → S3

The clip mask state was leaking into the drawing of the stroke mask texture.
This caused the stroke mask to be erroneously clipped out.

Assignee: nobody → lsalzman
Status: NEW → ASSIGNED
Flags: needinfo?(lsalzman)
Pushed by lsalzman@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/843e65079be1 Ignore the clip mask when drawing a stroke mask. r=aosmond

Backed out for causing build bustages in DrawTargetWebgl.cpp

  • Backout link
  • Push with failures
  • Failure Log
  • Failure line: /builds/worker/checkouts/gecko/dom/canvas/DrawTargetWebgl.cpp:3122:24: error: no viable conversion from 'RefPtr<WebGLTextureJS>' to 'RefPtr<WebGLTexture>'
Flags: needinfo?(lsalzman)
Flags: needinfo?(lsalzman)
Pushed by lsalzman@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0d100cd406fa Ignore the clip mask when drawing a stroke mask. r=aosmond
Flags: needinfo?(lsalzman)
Pushed by lsalzman@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e18fb59cd6ce Ignore the clip mask when drawing a stroke mask. r=aosmond
Status: ASSIGNED → RESOLVED
Closed: 1 years ago
Resolution: --- → FIXED
Target Milestone: --- → 119 Branch

The lines have started drawing, but they look different.

See the attached picture : gpu-canvas Vs Skia-Canvas Vs Chrome

Flags: needinfo?(lsalzman)
Flags: needinfo?(lsalzman)
Pushed by lsalzman@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8fe83891664d Only clear last clip mask when destroying clip mask. r=aosmond

Comment on attachment 9351417 [details]
Bug 1850727 - Only clear last clip mask when destroying clip mask. r?aosmond

Beta/Release Uplift Approval Request

  • User impact if declined: Canvas2D will fail to draw certain types of stroked geometry.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Verified by repro'd testcase.
  • String changes made/needed:
  • Is Android affected?: Yes
Attachment #9351417 - Flags: approval-mozilla-beta?
Attachment #9351153 - Flags: approval-mozilla-beta?
Attachment #9351153 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Comment on attachment 9351417 [details]
Bug 1850727 - Only clear last clip mask when destroying clip mask. r?aosmond

Approved for 118.0b6, thanks.

Attachment #9351417 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
QA Whiteboard: [qa-triaged]

I was able to reproduce the issue on Mac 12.6 using FF build 117.0 (the square was not completely displayed on old builds).
Verified as fixed on Mac 12.6 / Win10x64 using FF build 119.0a1 and 118.0b7.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: