Closed Bug 1575258 Opened 5 years ago Closed 5 years ago

Text blurry after expanding tiles on microsoftedgeinsider.com site

Categories

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

70 Branch
All
Unspecified
defect

Tracking

()

VERIFIED FIXED
mozilla72
Tracking Status
firefox72 --- verified

People

(Reporter: mystiquewolf, Assigned: aosmond)

References

Details

(Keywords: nightly-community)

Attachments

(8 files)

Attached image Before expanding

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:70.0) Gecko/20100101 Firefox/70.0

Steps to reproduce:

  1. Open https://www.microsoftedgeinsider.com/bg-bg/whats-new
  2. Expand some tile

Actual results:

The text inside the tile after expanding it is blurry. In Chrome it is not so.

Expected results:

Text should not be blurry.

Attachment #9086699 - Attachment description: 2019-08-20_19-27.png → Before expanding
Attached image After expanding Firefox
Attached image After expanding Chrome
Attached file Troubleshooting info

Couldn't reproduce this issue on Ubuntu 18.04 x64 on Firefox Nightly 70.0a1, Firefox 69.0b16 and on Firefox 68.0.2.

Could you please try to reproduce this issue using a fresh profile? You have the steps here: https://support.mozilla.org/en-US/kb/profile-manager-create-and-remove-firefox-profiles?redirectlocale=en-US&redirectslug=Managing-profiles#w_starting-the-profile-manager

Thanks.

Flags: needinfo?(liubomirwm)

The issue seems to appear only when webrender is enabled. Toggling gfx.webrender.force-disable solves the issue for me.

Flags: needinfo?(liubomirwm)

Setting "Core: Graphics: WebRender" component for this.

Component: Untriaged → Graphics: WebRender
Product: Firefox → Core
Blocks: wr-70
Flags: needinfo?(lsalzman)
Priority: -- → P3

This is pretty serious. It looks like we're messing up the snapping or bounds of the text. It gets cut off, it gets blurry, it jiggles.

The core issue here is an animation that animated in a second copy of the content with opacity, scale(1.0681818182), and possibly some other key tweaks. It also sort of looks like WR is failing to "exit" animation mode?

Status: UNCONFIRMED → NEW
Has STR: --- → yes
Ever confirmed: true
Priority: P3 → P2
Hardware: Unspecified → All

My snapping changes do not fix this, not during the animation and not after. The most relevant change is that we no longer snap during the animation but it still looks odd. As such, I suspect the text shader snapping might be relevant here.

Attached file reduced-test.html

Ok here's a heavily reduced test-case. I've identified that this requires:

  • an outer div with an animation that references "transform" and has an "animation-fill-mode: forwards".
  • an inner div with a subtle scale transform.

This combination makes webrender sad, and it acts like it's "stuck" in an animation (while also seemingly doing a bad job drawing the text in that animation). The animation and its transform don't need to actually do anything. For instance, in my test all it contains is 100% { transform: none }.

I think the animation-fill-mode is tricking everything to stay in "animation mode". If I replace animation-fill-mode with "animation-duration: 2s", we still render badly for 2 seconds, but then snap into a good quality text at the end.

So there's kinda two bugs here:

  • we're producing really ugly results in this animation (perhaps acceptable for real animations, but this is particularly egregious. it looks like each glyph is getting randomly stretched or cut off, like we're messing up snapping)
  • animation-fill-mode: forward keeps us trapped in this animation

You could also argue it's a bug that we enter animation mode even for animations that don't actually do anything, but that's more debatable, as it's a reasonable heuristic to expect an animation to be animated (and it may be difficult to detect otherwise).

Attachment #9090132 - Attachment mime type: text/plain → text/html
Assignee: nobody → a.beingessner
Flags: needinfo?(lsalzman)

Andrew seems to have fixed this while working on Bug 1555376 (which makes sense, my investigating had led me to the same basic places in the code), so transferring the bug to him.

Assignee: a.beingessner → aosmond

Just for the sake of history: the issue for this one seemed to be that we were messing up some of our snapping logic in the RasterSpace::Local case, which resulted in the vertex shader producing bad coordinates for the vertices, which inevitably messed up the pixel shader (since it couldn't even reach all of the pixels it needed to).

Blocks: wr-71
No longer blocks: wr-70

The glyph pixel space in which we rasterized glyphs differed from how we
rendered the rasterized glyphs in the shader. They need to be in
agreement because the glyph subpixel offset selected during
rasterization depends on it. This patch should make the paths consistent
with each other.

Additionally, during animations, we now snap the reference frame
relative offset ignoring the impact of any animated transforms. This
helps with minimizing glyph wiggling during the transition.

Pushed by aosmond@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4c4b65f3e7fb
Make text rasterize, render and snap glyphs consistently. r=lsalzman
Backout by csabou@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/09a93ed6c6f7
Backed out changeset 4c4b65f3e7fb for causing wrench bustages. CLOSED TREE
Pushed by aosmond@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1e12f9b18127
Make text rasterize, render and snap glyphs consistently. r=lsalzman
Blocks: wr-72
No longer blocks: wr-71
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
Blocks: 1587441

This is still a little bit not as sharp as before expanding the tile, but it's better now.

Attached image 2019-11-18_20-31.png
Attached image 2019-11-28_19-48.png

First one is a different bug.

Regressions: 1600237
Regressions: 1595735

(In reply to Lyubomir Parvanov from comment #21)

First one is a different bug.

If you continue to see this on the latest nightlies, please open a new bug, as I believe this should have been fixed as part of bug 1555376. Thanks!

Flags: needinfo?(aosmond)

RE: https://bugzilla.mozilla.org/show_bug.cgi?id=1575258#c20

We've effectively done everything we can for this page. The ultimate problem that remains is that:

  1. they're fading out the old text, and fading in similar-but-scaled text, which looks bad
  2. they're scaling and animating the text with animation-fill-mode: forwards, which the spec currently specifies as implying will-change, which looks bad

1 is just fundamentally a bad effect, but 2 is more subtle and merits a bit of explanation. Basically, they're animating in some slightly scaled text which requires us to slightly stretch the text and use (less crisp) greyscale-aa. Normally this would be fine as it would only be like that for the extent of the animation, and then snap back to a higher quality rendering... BUT they're explicitly requesting that the content stay in "animation mode" forever by using fill-mode, so we have to keep the text in this ugly form forever to preserve how it looked during the animation.

So IMO the page is definitely ugly but that's just because they made an ugly page and we're accurately rendering it. So, WONTFIX from our side.

Flags: qe-verify+

Reproduced the issue with firefox 70.0a1 (20190820215247) on Windows 10x64 using STR from comment 0 and test case from comment 9.
The issue is verified fixed with Firefox 72.0b5 (20191210230245) on Windows 10x64, macOS 10.15 and Ubuntu 18.04 while having WebRender enabled.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: