Closed Bug 1801584 Opened 2 years ago Closed 2 years ago

[HWA] Stroking a single rect with transform doesn't use antialising

Categories

(Core :: Graphics: Canvas2D, defect)

Firefox 109
defect

Tracking

()

RESOLVED FIXED
109 Branch
Tracking Status
firefox-esr102 --- unaffected
firefox107 --- disabled
firefox108 --- disabled
firefox109 --- fixed

People

(Reporter: tristan.fraipont, Assigned: lsalzman)

References

(Blocks 1 open bug, Regressed 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(4 files)

Attached file test-case.html

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:107.0) Gecko/20100101 Firefox/107.0

Steps to reproduce:

  1. Ensure to have gfx.canvas.accelerated flag set on.
  2. Set a canvas 2D context current transform to a rotated matrix.
  3. Stroke a rectangle on that context.

Actual results:

The rectangle is stroked without antialiasing.

Expected results:

The rectangle should have been drawn with antialiasing.

This happens only with true rectangles. Adding anything else to the subpath, even a single moveTo call, will make it render as expected.
It also doesn't affect rectangles transformed through Path2D.addPath(path, matrix).
I noticed this by seeing 4 new failures in https://wpt.fyi/results/result/css/geometry/DOMMatrix2DInit-validate-fixup.html since Hardware Acceleration defaults to true on macOS (Bug 1773712).

Can repro on Windows also.

2022-11-21T12:46:21.549000: DEBUG : Found commit message:
Bug 1779681 - Mark WebGL framebuffer as initially valid in DrawTargetWebgl. r=aosmond,gfx-reviewers

mWebglValid gets initialized to false, but it will never get reset to true until the next
frame, causing us to render into Skia the first frame rather than accelerate. Therefor, we
should just initialize it to valid. Since it is cleared to zero initially, this is safe.

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

2022-11-21T12:46:21.549000: DEBUG : Did not find a branch, checking all integration branches
2022-11-21T12:46:21.549000: INFO : The bisection is done.
2022-11-21T12:46:21.564000: INFO : Stopped

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

This is a known limitation of the 'copy' composite operation.

Severity: -- → S4
Flags: needinfo?(lsalzman)
Blocks: gpu-canvas

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

(In reply to Lee Salzman [:lsalzman] from comment #3)

This is a known limitation of the 'copy' composite operation.

I don't think this bug is related to "copy". I attach a new test-case where the zooming is done on a separate canvas to avoid "copy".

WebGL doesn't reliably implement line smoothing, so we can't rely on it, making it
useless canvas lines. Instead, just fall back to emulating it manually with paths.

Assignee: nobody → lsalzman
Status: NEW → ASSIGNED
Pushed by lsalzman@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b6982814673a
Avoid relying on WebGL line smoothing. r=jrmuizel
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 109 Branch
QA Whiteboard: [qa-109b-p2]
Regressions: 1817455
Regressions: 1860502
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: