Closed Bug 1559861 Opened 2 years ago Closed 10 months ago

Fuzzy text on office.com with apz.allow_zooming enabled (3d transforms cause fuzzy text, webrender version)

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla78
Tracking Status
firefox69 --- wontfix
firefox78 --- fixed

People

(Reporter: yoasif, Assigned: cbrewster)

References

(Blocks 1 open bug, )

Details

(Keywords: nightly-community, Whiteboard: apz-planning)

Attachments

(5 files)

  1. enable apz.allow_zooming;true
  2. navigate to https://www.office.com/
  3. pinch to zoom

What happens:

The text "Welcome to Office Your place to create, communicate, collaborate, and get great work done." is fuzzy.

Expected result:

Sharp text.

Attached file wr-support

Please mention what platform this is on. Thanks!

Priority: -- → P3

I'm on Linux.

Attachment #9072587 - Attachment mime type: application/octet-stream → text/plain

FYI this is also reproducible on macOS.

Whiteboard: desktop-zoom-nightly
Whiteboard: desktop-zoom-nightly → apz-planning

I'm not able to reproduce this on macOS on the latest nightly, with or without WebRender. Can you recheck?

Flags: needinfo?(yoasif)

Kats, try https://web.archive.org/web/20200101011105/https://www.office.com/ - the page has changed since I reported the bug.

I can still reproduce it on macOS and Linux.

Flags: needinfo?(yoasif)

Thanks, I can repro on the archive.org link as well.

This appears to be coming from the transform-style: preserve-3d style on the enclosing <div class="home__container">. The current version of office.com doesn't have this style and zooming in keeps things sharp. If I remove this style from the archive.org version it also works fine. Presumably this style is changing our layer tree structure somehow to rasterize at a lower resolution than what we would like.

The interesting thing is that it happens with both WR on and off, at least in my testing. The two should be using pretty different codepaths in this respect, but maybe they use the same ChooseScaleAndSetTransform code and that might be the culprit. Not sure, needs more investigation.

The reduced testcase and the archive.org link both show the fuzzy text on fenix on android (it doesn't render well enough to check on fennec). The reduced testcase has fuzzy text on fennec and fenix. So not unique to desktop zooming.

You can get the same effect with just a transform, no need for zooming.

See Also: → 1637796

This patch adjusts the device pixel scale for raster root surfaces so that the surface's content is not
pixelated/blurred when it is composited into its parent surface where a transform scales up the surface.

This only fixes the referenced bug when WebRender is used.

Assignee: nobody → connorbrewster
Status: NEW → ASSIGNED

(In reply to Connor Brewster [:cbrewster] from comment #12)

This only fixes the referenced bug when WebRender is used.

Do you have any plans to fix or investigate the non-WebRender version of this bug?

Flags: needinfo?(connorbrewster)

I'm not nearly as familiar with the non-WR rendering path, but I did a little bit of digging and I think this would be fixed by handling the 3D transform case in FrameLayerBuilder::ChooseScale. (https://searchfox.org/mozilla-central/rev/9f074fab9bf905fad62e7cc32faf121195f4ba46/layout/painting/FrameLayerBuilder.cpp#6030)

I'm happy to work on a fix for the non-WR path, but I may need some guidance.

Flags: needinfo?(connorbrewster)

I have a fix for the non-wr bug.

More or less this

https://treeherder.mozilla.org/#/jobs?repo=try&revision=4aa5e23d53a03b8fd96ebba26a7ecac528ec30bc

but I'm holding off because I have more important fixes to ChooseScale stuff to land first (ie regression fixes) before making an improvement fix that could cause regressions.

Great, thank you both!

I think that the non-wr side of this should be split off into a separate bug so it can land separately and just make this bug about wr.

Pushed by dluca@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/41acfa78dae4
WR - Scale picture tasks based on their surface to parent transform scale factors r=gw,Bert
Flags: needinfo?(connorbrewster)
Pushed by ncsoregi@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a94271c84318
WR - Scale picture tasks based on their surface to parent transform scale factors r=gw,Bert
Summary: Fuzzy text on office.com with apz.allow_zooming enabled → Fuzzy text on office.com with apz.allow_zooming enabled (3d transforms cause fuzzy text, webrender version)
Component: Panning and Zooming → Graphics: WebRender

Filed bug 1639764 for the non-wr case as well as for webrender content that uses a scale from ChooseScale.

Status: ASSIGNED → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla78
Regressions: 1642440
Regressions: 1642549
Regressions: 1645560
You need to log in before you can comment on or make changes to this bug.