Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebRender doesn't respect ClearType parameters #2407

Closed
automatedbugreportingfacility opened this issue Feb 11, 2018 · 16 comments
Closed

WebRender doesn't respect ClearType parameters #2407

automatedbugreportingfacility opened this issue Feb 11, 2018 · 16 comments
Labels

Comments

@automatedbugreportingfacility
Copy link

@automatedbugreportingfacility automatedbugreportingfacility commented Feb 11, 2018

Test case:
data:text/html,abcdefghijklmnopqrstuvwxyz

ClearType enabled, Gamma: 2.2 Pixel Structure: BGR ClearType Level: 0 Enhanced Contrast: 0
WebRender off: https://i.imgur.com/bV4HjfK.png
WebRender on: https://i.imgur.com/V3xJ5IN.png

ClearType enabled, Gamma: 2.2 Pixel Structure: RGB ClearType Level: 100 Enhanced Contrast: 400
WebRender off: https://i.imgur.com/zYKWHE0.png
WebRender on: https://i.imgur.com/boU7srJ.png

As can be seen, WebRender gives exactly the same output in both cases.

OS: Windows 10
GPU: Nvidia GeForce GTX 970
Browser: Nightly 60.0a1 (2018-02-11) (64-bit)

@glennw
Copy link
Member

@glennw glennw commented Feb 11, 2018

@kvark kvark added the type: bug label Feb 14, 2018
@kvark
Copy link
Member

@kvark kvark commented Feb 14, 2018

Please note that you can drop the images right into Github issue/comment area, showing them inline:

off on
off on
off on
@Gankra
Copy link
Contributor

@Gankra Gankra commented Jul 11, 2018

possibly related: on windows, a google spread sheet with arial text has terrible kerning right now

@Gankra
Copy link
Contributor

@Gankra Gankra commented Jul 11, 2018

false alarm: that is a bug even vanilla gecko has right now

@GoGoris
Copy link

@GoGoris GoGoris commented Jul 16, 2018

I tested Firefox Nightly with webrender and Firefox Developer Edition side to side and there was a clear difference in font rendering between the two: #2867

@mstange
Copy link
Contributor

@mstange mstange commented Aug 22, 2018

@automatedbugreportingfacility is this fixed now? #2896 might have fixed it.

@gw3583
Copy link
Collaborator

@gw3583 gw3583 commented Aug 28, 2018

I believe this is fixed - @automatedbugreportingfacility could you confirm?

@automatedbugreportingfacility
Copy link
Author

@automatedbugreportingfacility automatedbugreportingfacility commented Sep 5, 2018

This is definitely very close to the expected result after the fixes. However, for some reason, I'm still not getting pixel-to-pixel match for WebRender on/off in this basic case:

URL: data:text/html,abcdefghijklmnopqrstuvwxyz
ClearType Parameters: Gamma: 2.2 Pixel Structure: BGR ClearType Level: 0 Enhanced Contrast: 0

WebRender off WebRender on
22-bgr-0-0-nowr 22-bgr-0-0-wr

I'm not sure if this is expected or not. At the very least, there must be some difference.

Attempting to dig a little deeper, I've devised the following testcase:
URL: data:text/html,<div style="font-size:5000">a</div><script>scrollTo(0,875)</script>
ClearType Parameters: Gamma: 2.2 Pixel Structure: BGR ClearType Level: 0 Enhanced Contrast: 0

WebRender off WebRender on
a-22-bgr-0-0-nowr a-22-bgr-0-0-wr

As can be seen, edges of the character are significantly more blurred in the WebRender case.

@mstange
Copy link
Contributor

@mstange mstange commented Sep 5, 2018

However, for some reason, I'm still not getting pixel-to-pixel match for WebRender on/off in this basic case:
URL: data:text/html,abcdefghijklmnopqrstuvwxyz
I'm not sure if this is expected or not. At the very least, there must be some difference.

That's an interesting case. The font rendering inside the URL bar looks identical to my eyes, but I didn't check the pixel values. What's interesting though are the differences in the tab text and in the content. WebRender doesn't use subpixel AA in the tabs yet (that's tracked by bug 1455393), so the tab text difference is expected. However, it looks like non-WebRender doesn't use subpixel AA in the tab content on your machine! That's really unexpected.

As can be seen, edges of the character are significantly more blurred in the WebRender case.

This is also interesting but it's probably a separate bug that only affects very large font sizes.

@Gankra
Copy link
Contributor

@Gankra Gankra commented Sep 5, 2018

In the very large case I expect you're running into webrender's current upper-bound on glyph-size, where it starts to render at a smaller size and just upscale. A known, separate issue.

@lsalzman
Copy link
Contributor

@lsalzman lsalzman commented Sep 5, 2018

Yes, that's just a case of hitting the font size limit. Since we don't use path rasterization above the limit like Skia does, the results won't be the same if you use an absurdly large font size like in that example.

@mstange
Copy link
Contributor

@mstange mstange commented Sep 5, 2018

All right, then I recommend closing this issue.

@automatedbugreportingfacility
Copy link
Author

@automatedbugreportingfacility automatedbugreportingfacility commented Sep 5, 2018

However, it looks like non-WebRender doesn't use subpixel AA in the tab content on your machine! That's really unexpected.

I can investigate this further, if needed. The setup is pretty regular: the latest Nightly, GeForce GTX 970 running with the latest drivers (8-21-2018). From what I gathered, I can verify that subpixel AA is used or not by zooming into the screenshot and seeing if characters are slightly colored?

@lsalzman
Copy link
Contributor

@lsalzman lsalzman commented Sep 5, 2018

Subpixel AA is disabled at huge sizes where the font is scaled up, since the entire idea of subpixels thus breaks down. It's expected.

@mstange
Copy link
Contributor

@mstange mstange commented Sep 5, 2018

From what I gathered, I can verify that subpixel AA is used or not by zooming into the screenshot and seeing if characters are slightly colored?

That's right. Your test page is the simplest page imaginable, so I'd be surprised if more complicated pages used subpixel AA when this page is not... in any case, this is not a WebRender bug, so if you'd like to investigate this further, please file a bug on bugzilla.mozilla.org in the Graphics: Layers component and we can discuss there.

@lsalzman the non-WebRender broken case is the one with the regular font size

@automatedbugreportingfacility
Copy link
Author

@automatedbugreportingfacility automatedbugreportingfacility commented Sep 5, 2018

Okay, thank you for the comments and fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
8 participants
You can’t perform that action at this time.