Closed Bug 2080469 Opened 1 month ago Closed 14 days ago

Blurred translucent Canvas2D strokes disappear with accelerated rendering.

Categories

(Core :: Graphics: Canvas2D, defect)

Firefox 159
defect

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: python273, Assigned: python273)

Details

Attachments

(1 file, 1 external file)

Steps to reproduce

  1. Open the attached minimal-repro.html with hardware-accelerated Canvas2D enabled.
  2. Observe the canvas and the painted-pixel count printed below it.

Reproduces on Linux/X11 with Firefox 159.0a1 (revision 953be279951f07690621f6086ec11458249763c6, fresh profile) and on macOS with Firefox 157.

Tested user agents:

  • Linux: Mozilla/5.0 (X11; Linux x86_64; rv:159.0) Gecko/20100101 Firefox/159.0
  • macOS: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:157.0) Gecko/20100101 Firefox/157.0

Actual results

The dot is missing: blank canvas, 0 painted pixels, center alpha 0.

Relevant logs or errors

GDB captured the internal WebGL rejection:

WebGL warning: drawArraysInstanced: Texture level 0 would be read by TEXTURE_2D unit 0, but written by framebuffer attachment COLOR_ATTACHMENT0, which would be illegal feedback.

Conditions and workarounds

The dot appears with globalAlpha=1, no blur, or { willReadFrequently: true }. These settings also avoid the failure: gfx.canvas.accelerated=false, gfx.canvas.accelerated.aa-stroke.enabled=false, or gfx.canvas.accelerated.shared-page-size=0.

Diagnosis

Confirmed texture feedback: the A8 stroke mask and filter-input target share a backing texture. Sampling it while rendering into it is illegal, even for distinct atlas rectangles. The accelerated path reports success despite the rejected draw. Cached masks also alias.

Expected results

A blurred, partially transparent black dot should be visible near the bottom right; painted pixels should be nonzero.

Allocate new stroke masks away from the current render target's backing
texture while preserving shared-page allocation. Reject aliased surface
draws so cached masks use the existing fallback instead of silently
losing the filtered stroke.

Add GPU regression coverage for fresh and primed masks, alpha, colors,
positions, and HTML/OffscreenCanvas contexts.

Assignee: nobody → python273-bugzilla
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

The severity field is not set for this bug.
:lsalzman, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(lsalzman)
Severity: -- → S3
Flags: needinfo?(lsalzman)
Pushed by lsalzman@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/69de132748a0 https://hg.mozilla.org/integration/autoland/rev/8da33c0117cf Prevent texture feedback when rendering blurred Canvas2D strokes. r=lsalzman,gfx-reviewers
Status: ASSIGNED → RESOLVED
Closed: 14 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: