Closed Bug 1817455 Opened 1 year ago Closed 1 year ago

Misplaced fill in the profiler marker chart

Categories

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

defect

Tracking

()

RESOLVED FIXED
112 Branch
Tracking Status
firefox-esr102 --- unaffected
firefox110 --- wontfix
firefox111 --- fixed
firefox112 --- fixed

People

(Reporter: mstange, Assigned: lsalzman)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

This was originally reported in https://github.com/firefox-devtools/profiler/issues/4477 .

Steps to reproduce:

  1. Load https://share.firefox.dev/3k43pAZ
  2. Look at the blue fill of the first box in the marker chart, the 300,000ms box next to the word DataStorageTimer
  3. Try different page zoom levels.

Expected results:
The box should be filled completely and the fill shouldn't overflow.

Actual results:
Sometimes the fill is not filling the entire box, and sometimes it is overflowing, depending on zoom level.

Lee, can you please have a look?

Note: I'm not able to reproduce on Win10/64 using Fx109 even up to +200% zoom, but I'm on SW-WR.

Severity: -- → S3
Flags: needinfo?(lsalzman)
Priority: -- → P2

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

Rectangle with large floating-point values can start to lose mantissa bits when transformed directly
by the vertex shader, pushed through the viewport transform, and then clipped later. OTOH, the path
fallback (WGR/AA-Stroke or Skia) does not stress floating-point precision as much, so generally
returns more correct results in these cases. This becomes noticeable when the same rectangle is
filled and then subsequently stroked, since the fill may use the rect shader, while the the stroke
will fall back to using a path.

To avoid hitting this issue, this checks if a rect's coordinate are outside as certain reasonable
limit, and if so, falls back to relying on path geometry to handle transform and clipping safely.
If within the limit, the shader precision loss doesn't noticeably impact the results so it is still
safe to use the fast-path.

Assignee: nobody → lsalzman
Status: NEW → ASSIGNED
Flags: needinfo?(lsalzman)
Pushed by lsalzman@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f85246882e34
Limit rect precision to avoid shader rounding diverging from path fallback. r=gfx-reviewers,aosmond
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 112 Branch

The patch landed in nightly and beta is affected.
:lsalzman, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox111 to wontfix.

For more information, please visit auto_nag documentation.

Flags: needinfo?(lsalzman)

Comment on attachment 9318541 [details]
Bug 1817455 - Limit rect precision to avoid shader rounding diverging from path fallback. r?jrmuizel

Beta/Release Uplift Approval Request

  • User impact if declined: Potential visual artifacts in certain Canvas2D applications such as Firefox Profiler.
  • 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): Just disables a fast-path in certain situations that is causing some numerical accuracy issues.
  • String changes made/needed:
  • Is Android affected?: No
Flags: needinfo?(lsalzman)
Attachment #9318541 - Flags: approval-mozilla-beta?

Comment on attachment 9318541 [details]
Bug 1817455 - Limit rect precision to avoid shader rounding diverging from path fallback. r?jrmuizel

Approved for 111.0b5

Attachment #9318541 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
See Also: → 1820532
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: