Closed Bug 1851963 Opened 1 year ago Closed 9 months ago

Color Gradient does not work as expected with hardware acceleration enabled. [RTX A500, canvas2d, d2d]

Categories

(Core :: Graphics: Canvas2D, defect)

Firefox 117
defect

Tracking

()

RESOLVED FIXED
125 Branch
Tracking Status
firefox-esr102 --- unaffected
firefox-esr115 --- unaffected
firefox117 --- wontfix
firefox118 --- wontfix
firefox119 --- wontfix
firefox120 --- wontfix
firefox121 --- wontfix
firefox123 --- fixed
firefox124 --- fixed
firefox125 --- fixed

People

(Reporter: hanichkranich, Assigned: lsalzman)

References

(Regression)

Details

(Keywords: regression)

Attachments

(5 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 Edg/116.0.1938.62

Steps to reproduce:

Opened https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/createConicGradient and checked the "Rectangle result" image.

Hardware acceleration is enabled, RTX A500.

Without hardware acceleration it works as expected.

Actual results:

The image is shown but with wrong and faded colours. (see image)

Expected results:

The colours should be normal.

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

Component: Untriaged → Graphics: CanvasWebGL
Product: Firefox → Core

Can repro on Windows11x64 with D2d-Canvas.

Regression range: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=38b06f0c751021f94bebb032242b2326666ec476&tochange=b2154b397ef787592eb1b88ebade9957d33df816
Regressing bug (from mozregression) : Bug 1834815 - Enable full+cross LTO by default for shippable Linux and Windows build r=glandium

I cant repro with Skia-canvas. So it looks like Bug 1834815 broke D2D canvas backend somehow??

Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: regression
Regressed by: 1834815
Attached file about:support

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

:sergesanspaille, since you are the author of the regressor, bug 1834815, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

Severity: -- → S3
Component: Graphics: CanvasWebGL → Graphics: Canvas2D
Flags: needinfo?(lsalzman)
Summary: Color Gradient does not work as expected with hardware acceleration enabled. RTX A500 → Color Gradient does not work as expected with hardware acceleration enabled. [RTX A500, canvas2d, d2d]

From a distance, this may be a compiler backend issue... But I'm not quite sure about the approach that should be taken to narrow this :-/

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

Duplicate of this bug: 1860005

Just to confirm that it's related to Full LTO, can someone compiled a version linked with either ThinLTO or no lto at all and confirm the bug no longer appears?

Flags: needinfo?(sguelton)
Duplicate of this bug: 1871443
Duplicate of this bug: 1873690
See Also: → 1878517

I have no idea why LTO would cause this, other than it maybe messing up something in DrawTargetD2D1, like dispatching to the wrong shader somehow?

Jeff, any ideas?

Flags: needinfo?(lsalzman) → needinfo?(jmuizelaar)
Duplicate of this bug: 1878517

Although char is usually unsigned, somehow the conversion between float to
char may be clamping, as noted in bug 1787085. We want to explicitly use
unsigned char here, which is the right thing to do.

Assignee: nobody → lsalzman
Status: NEW → ASSIGNED
See Also: → 1787085
Pushed by lsalzman@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e41427b3c43b Use unsigned char in ConicGradientEffectD2D1. r=jrmuizel
Status: ASSIGNED → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → 125 Branch

The attached testcase is colored as expected on the latest Nightly.

Comment on attachment 9382092 [details]
Bug 1851963 - Use unsigned char in ConicGradientEffectD2D1. r?jrmuizel

Beta/Release Uplift Approval Request

  • User impact if declined: Conic gradients are broken on Windows.
  • Is this code covered by automated tests?: Unknown
  • 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): This is a small fix to remove some undefined behavior that is causing undesired clamping of rendering results to be generated. We have employed a similar fix several releases ago for radial gradients that was well-tolerated.
  • String changes made/needed:
  • Is Android affected?: Unknown
Attachment #9382092 - Flags: approval-mozilla-beta?

Comment on attachment 9382092 [details]
Bug 1851963 - Use unsigned char in ConicGradientEffectD2D1. r?jrmuizel

Beta/Release Uplift Approval Request

  • User impact if declined: Conic gradients are broken on Windows.
  • Is this code covered by automated tests?: Unknown
  • 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): This is a small fix to remove some undefined behavior that is causing undesired clamping of rendering results to be generated. We have employed a similar fix several releases ago for radial gradients that was well-tolerated.
  • String changes made/needed:
  • Is Android affected?: No
Attachment #9382092 - Flags: approval-mozilla-release?

Comment on attachment 9382092 [details]
Bug 1851963 - Use unsigned char in ConicGradientEffectD2D1. r?jrmuizel

Approved for 124.0b4

Attachment #9382092 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Comment on attachment 9382092 [details]
Bug 1851963 - Use unsigned char in ConicGradientEffectD2D1. r?jrmuizel

Low risk, let's take it in our planned dot release next week, thanks.

Attachment #9382092 - Flags: approval-mozilla-release? → approval-mozilla-release+
Duplicate of this bug: 1883147
See Also: 1878517
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: