Closed Bug 1841020 Opened 3 years ago Closed 2 years ago

Artifacts when rendering mitered paths

Categories

(Core :: Graphics: Canvas2D, defect, P2)

defect

Tracking

()

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

People

(Reporter: calixte, Assigned: jrmuizel)

References

(Regression)

Details

(Keywords: regression, Whiteboard: [sp3])

Attachments

(5 files)

Attached file test_miter.pdf

It's a mirror bug of:
https://github.com/mozilla/pdf.js/issues/16619

There are some artifacts when rendering the path.
It's ok with gfx.canvas.accelerated set to false.

:lsalzman, any idea ?

Flags: needinfo?(lsalzman)

Regression range:
Bug 1803604 - Use aa-stroke to accelerate stroked paths in Canvas2D. r=jrmuizel

Differential Revision: https://phabricator.services.mozilla.com/D163609

Keywords: regression
Regressed by: 1803604

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

Severity: -- → S3
Priority: -- → P2

Jeff, this looks like a bug in aa-stroke itself. Repros on Linux too (reporter on Mac). Doesn't appear to be driver specific.

Flags: needinfo?(lsalzman) → needinfo?(jmuizelaar)

Calixte, can this please me made into a standalone, non-pdf testcase, just calling directly into Canvas2D? That would make it easier to debug. The PDF is pretty opaque.

Flags: needinfo?(cdenizet)
Attached file bug1841020.html
Flags: needinfo?(cdenizet)

On mac, with 114.0.2, the attached html is ok but the pdf is not...
With nightly, both test cases have the artifacts.

Here's a very reduced test case.
The artifacts are two thin dotted lines tangent to the bezier curves.

I just tested the three test cases on Windows 11 with gfx.canvas.accelerated set to true, and all of them are showing the artifacts.

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

Attached image en-roads-1.png

(I'm adding this comment in case the linked En-ROADS example is useful in verifying the eventual fix for the underlying issue. I didn't think it warranted it's own issue since the underlying problem seems the same; apologies if piling on to an existing issue is bad form.)

I believe this is the same issue that we are encountering in En-ROADS, where there are sporadic rendering artifacts seen on certain line graphs. See attached screenshot (en-roads-1.png).

This started appearing after upgrading to Firefox 115 (I'm on macOS). The bug appears only at certain window sizes. It can be reproduced by slowly changing the browser window width.

I verified that the bug does not appear after disabling the new aa stroke renderer flag (gfx.canvas.accelerated.aa-stroke.enabled = false). Unchecking the "Use hardware acceleration when available" setting also has the same effect, as expected.

Assignee: nobody → jmuizelaar
Flags: needinfo?(jmuizelaar)

It looks like there's some numerical instability around miter joins. I hope to solve it by the end of the week.

See Also: → 1843143

This updates aa-stroke to fef8702c4c8afd7d47e7a5aafb6fa347c96b50be
which fixes some degenerate behaviour when mitering parallel lines.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 118 Branch
Duplicate of this bug: 1846207

Backed out as requested by jrmuizel

Status: RESOLVED → REOPENED
Flags: needinfo?(jmuizelaar)
Resolution: FIXED → ---
Target Milestone: 118 Branch → ---

Backed out for making bug 1849487 worse.

Flags: needinfo?(jmuizelaar)

FWIW, the reduced testcase did improve with the (now backed out) patch. But the original pdf still has those dotted lines that appear-disappear at different zoom levels, and become permanent after a certain zoom level (300% on my machine)

Status: REOPENED → RESOLVED
Closed: 2 years ago2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 118 Branch
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: 118 Branch → ---
Status: REOPENED → RESOLVED
Closed: 2 years ago2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 119 Branch
Blocks: 1849487

(In reply to Mayank Bansal from comment #18)

FWIW, the reduced testcase did improve with the (now backed out) patch. But the original pdf still has those dotted lines that appear-disappear at different zoom levels, and become permanent after a certain zoom level (300% on my machine)

This is still true. The original pdf still has dotted line artifacts.

Whiteboard: [sp3]
Flags: qe-verify+

Reproducible on a 2023-08-24 Nightly build on macOS 12.
Verified as fixed on Firefox 119.0b2(build ID: 20230928191344) and Nightly 120.0a1(build ID: 20230928215127) on macOS 12, Windows 10, Ubuntu 22.

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

Attachment

General

Created:
Updated:
Size: