Closed Bug 1801512 Opened 1 year ago Closed 1 year ago

Firefox on Windows does not follow the current gamma values for font smoothing

Categories

(Core :: Graphics: Text, defect)

Firefox 107
Desktop
Windows
defect

Tracking

()

VERIFIED FIXED
109 Branch
Tracking Status
firefox-esr102 --- wontfix
firefox107 --- wontfix
firefox108 --- wontfix
firefox109 --- verified

People

(Reporter: ch4sys, Assigned: jfkthame)

References

Details

(Keywords: perf-alert)

Attachments

(1 file, 1 obsolete file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:107.0) Gecko/20100101 Firefox/107.0

Steps to reproduce:

In Windows (Windows 10 specifically), ClearType Tuner writes gamma to a registry value HKCU\Control Panel\Desktop FontSmoothingGamma.
At the same time, it always writes the value 2200 to the registry value HKCU\SOFTWARE\Microsoft\Avalon.Graphics\DISPLAY1 GammaLevel.

The system uses the first value! But Firefox uses the latter - and therefore does not show the fonts the way the user wants.

Example. the first is 2200, the second is 2200. The fonts look the same in the System and in Firefox.
https://i.imgur.com/M9clg5Z.png

Change the gamma value to 1000 and 2200, sign out, sign in.

Actual results:

The result is attached. (Duplicate https://i.imgur.com/iHHCWe0.png )
In the system, the fonts have become thicker, in Firefox they have not changed.

Expected results:

Fonts should be thicker in Firefox too.
This can be achieved by changing the second parameter manually.
1000 and 1000. Sign out, sign in.
Fonts have become thicker in Firefox too.
https://i.imgur.com/6q1wXto.png

Of course, the system always follows the first value.
Change the first, leave the second the same.
2200 and 1000. Sign out, sign in.
The system has changed, Firefox has not.
https://i.imgur.com/4y3aDpO.png

Component: Untriaged → General
OS: Unspecified → Windows
Component: General → Graphics: Text
Product: Firefox → Core

Lee, who would be the right person to look in to this?

Severity: -- → S4
Flags: needinfo?(lsalzman)

Jonathan, ideas?

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

Looking here, we don't seem to get the gamma value directly by reading the Avalon.Graphics\DISPLAY1 registry key; we get it from the defaultRenderingParams that the DWriteFactory gave us. Where the factory got it from is unclear to me.

Anyhow, presumably this is what ends up being passed through the platform font options to WebRender, and eventually used when we render.

I'm not at all sure how these various registry values are supposed to be used, or how they interact with each other. Maybe we should be looking at Control Panel\Desktop in the registry and using that in preference to the defaultRenderingParams value?

Flags: needinfo?(jfkthame)
Assignee: nobody → jfkthame
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

So we could try doing something like this, though it'll need some adjustments to reftest fuzz numbers. Try run: https://treeherder.mozilla.org/jobs?repo=try&revision=c66f4adb9ffa5dacc04d266c3e32fe2362bb7d04

I can't seem to set this up on my end, I have a Windows 10 machine, but after changing both FontSmoothingGamma - 1000 and Avalon.Graphics > Default - 1000, there is no difference on my Windows machine, text still looks the same (everywhere not just in Firefox), I only have the default file in the Avalon.Graphics, I havent seen the Display1 folder in the Avalon.Graphics, could that be the reason ?

(In reply to Rares Doghi from comment #6)

I can't seem to set this up on my end, I have a Windows 10 machine, but after changing both FontSmoothingGamma - 1000 and Avalon.Graphics > Default - 1000, there is no difference on my Windows machine, text still looks the same (everywhere not just in Firefox), I only have the default file in the Avalon.Graphics, I havent seen the Display1 folder in the Avalon.Graphics, could that be the reason ?

I wonder if the presence of Display1 etc is dependent on having multiple displays? But that's just a guess.

Hi @jonathan , I tried this on a Machine with only 1 monitor, a Laptop with an external monitor and another Desktop machine with 2 external monitors and Avalon.Graphics still does not have any folders for Display1, only the default key.

Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Avalon.Graphics - this is the path I was looking into.

We also tried on a Windows 7 machine with 2 external monitors and we do see the Avalon.Graphics /Display1 and Display2 folders there but on the same machine with Windows 10 those folders are missing.

Flags: needinfo?(jfkthame)

(In reply to Rares Doghi from comment #8)

Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Avalon.Graphics - this is the path I was looking into.

I checked in Windows Sandbox. DISPLAY1 appears after using ClearType Text Tuner.

Thanks @chaotic_sys, thats what I was missing(I had to go through the ClearType Text Tuner steps).
I was also able to reproduce this issue in our Lastest Nightly 109.0a1 (2022-11-24), Release 107, Beta 108.0b5 and ESR 102.

Hardware: Unspecified → Desktop
Flags: needinfo?(jfkthame)
Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/516ad0cab188
Respect the Control Panel FontSmoothingGamma value, if present. r=lsalzman

Backed out for causing reftest failures on 411334-1.xml

  • Backout link
  • Push with failures
  • Failure Log
  • Failure line: REFTEST TEST-UNEXPECTED-FAIL | layout/reftests/bugs/411334-1.xml == layout/reftests/bugs/411334-1-ref.xml | image comparison, max difference: 138, number of differing pixels: 770

Failure log: https://treeherder.mozilla.org/logviewer?job_id=397591047&repo=autoland
Failure line: REFTEST TEST-UNEXPECTED-FAIL | gfx/tests/reftest/picture-caching-on-async-zoom.html == gfx/tests/reftest/picture-caching-on-async-zoom.html?ref | image comparison, max difference: 112, number of differing pixels: 3430

Wpt failures: https://treeherder.mozilla.org/logviewer?job_id=397591991&repo=autoland
wpt failure line: TEST-UNEXPECTED-FAIL | /css/CSS2/normal-flow/min-height-106.xht | Testing http://web-platform.test:8000/css/CSS2/normal-flow/min-height-106.xht == http://web-platform.test:8000/css/CSS2/normal-flow/max-height-107-ref.xht

Flags: needinfo?(jfkthame)
Backout by ncsoregi@mozilla.com:
https://hg.mozilla.org/mozilla-central/rev/e12f31999d33
Backed out changeset 516ad0cab188 for causing reftest failures on 411334-1.xml CLOSED TREE
Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3fbfc9299ac6
Respect the Control Panel FontSmoothingGamma value, if present. r=lsalzman

Backed out for causing reftest failures on simple-underline-selection.svg

  • Backout link
  • Push with failures
  • Failure Log
  • Failure line: REFTEST TEST-UNEXPECTED-FAIL | layout/reftests/svg/text/simple-underline-selection.svg == layout/reftests/svg/text/simple-underline-selection-ref.html | image comparison, max difference: 63, number of differing pixels: 200
    REFTEST TEST-UNEXPECTED-FAIL | layout/reftests/svg/text/multiple-text-selection.svg == layout/reftests/svg/text/multiple-text-selection-ref.html | image comparison, max difference: 63, number of differing pixels: 382
Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c1b0ce76a51b
Respect the Control Panel FontSmoothingGamma value, if present. r=lsalzman
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 109 Branch
Flags: needinfo?(jfkthame)

Verified as fixed in our latest Nightly build 109.0a1 (2022-11-27) , changing the FontSmoothingGamma from Desktop will also affect Firefox now.

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

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

For more information, please visit auto_nag documentation.

Flags: needinfo?(jfkthame)
Regressions: 1803154

I don't think we should uplift this. It was a long-standing and fairly minor cosmetic issue, and it's also not currently clear whether the change is actually good (see bug 1803154); we may want to reconsider it.

Flags: needinfo?(jfkthame)

(In reply to Cristian Tuns from comment #16)

Backed out for causing reftest failures on simple-underline-selection.svg

  • Backout link
  • Push with failures
  • Failure Log
  • Failure line: REFTEST TEST-UNEXPECTED-FAIL | layout/reftests/svg/text/simple-underline-selection.svg == layout/reftests/svg/text/simple-underline-selection-ref.html | image comparison, max difference: 63, number of differing pixels: 200
    REFTEST TEST-UNEXPECTED-FAIL | layout/reftests/svg/text/multiple-text-selection.svg == layout/reftests/svg/text/multiple-text-selection-ref.html | image comparison, max difference: 63, number of differing pixels: 382

== Change summary for alert #36214 (as of Mon, 28 Nov 2022 16:52:31 GMT) ==

Improvements:

Ratio Test Platform Options Absolute values (old vs new)
4% google-docs ContentfulSpeedIndex windows10-64-shippable-qr cold fission webrender 1,257.96 -> 1,209.75

For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=36214

Keywords: perf-alert

(In reply to Cristian Tuns from comment #16)

Backed out for causing reftest failures on simple-underline-selection.svg

  • Backout link
  • Push with failures
  • Failure Log
  • Failure line: REFTEST TEST-UNEXPECTED-FAIL | layout/reftests/svg/text/simple-underline-selection.svg == layout/reftests/svg/text/simple-underline-selection-ref.html | image comparison, max difference: 63, number of differing pixels: 200
    REFTEST TEST-UNEXPECTED-FAIL | layout/reftests/svg/text/multiple-text-selection.svg == layout/reftests/svg/text/multiple-text-selection-ref.html | image comparison, max difference: 63, number of differing pixels: 382

== Change summary for alert #36229 (as of Tue, 29 Nov 2022 13:57:56 GMT) ==

Regressions:

Ratio Test Platform Options Absolute values (old vs new)
4% google-docs ContentfulSpeedIndex windows10-64-shippable-qr cold fission webrender 1,212.33 -> 1,266.33

For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=36229

== Change summary for alert #36230 (as of Tue, 29 Nov 2022 13:58:05 GMT) ==

Improvements:

Ratio Test Platform Options Absolute values (old vs new)
4% google-docs ContentfulSpeedIndex windows10-64-shippable-qr cold fission webrender 1,258.47 -> 1,202.94
4% google-docs ContentfulSpeedIndex windows10-64-shippable-qr fission warm webrender 1,059.18 -> 1,016.23

For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=36230

Updating the main Status flags.

Status: RESOLVED → VERIFIED

Just to note for the record: in bug 1803154, we have just backed out the patch that landed here. So the rendering will revert to how it was previously.

The various reports in bug 1803154 provide more background. It seems like things are more complex than we originally thought here, depending on various user settings (and maybe Windows version?), so we'll need to investigate and test more extensively when we try afresh to address this issue.

Attachment #9304530 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: