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

Transformed text seems to stretch glyph image border pixels, creating fringes around glyphs #1808

Closed
mstange opened this issue Oct 5, 2017 · 5 comments

Comments

@Gankra
Copy link
Contributor

@Gankra Gankra commented Oct 5, 2017

I'm pretty sure this is just subpixels. We currently render text before transforms, and with no regard for their existence.

@mstange
Copy link
Contributor Author

@mstange mstange commented Oct 5, 2017

I agree, this depends on #1542 and is just one of the things we should make sure works correctly once that's fixed. There will probably still be cases where we want to rasterize and then transform, and in those cases, this particular rendering error should not occur.

@Darkspirit
Copy link

@Darkspirit Darkspirit commented Oct 31, 2017

@mstange, is this also fixed by #1969?
(This is a See Also bug of the one where you linked that pull request half an hour ago.)

@mstange
Copy link
Contributor Author

@mstange mstange commented Oct 31, 2017

No, it's not. I'll remove it from the see also list.

bors-servo added a commit that referenced this issue Nov 21, 2017
support font subpixel AA with content transforms

This solves issue #1808. It ensures that we render subpixel AA in device space rather than layer local space, so as to side-step the issue with subpixels getting deformed by a layer transform.

The engine of this is FontTransform, which is the upper 2x2 submatrix of the layer transform and which is stored in the FontInstance - automatically and necessarily becoming part of the font key. That transform has to be passed down to the font backend so that rasterization actually uses it.

In the text shader, we can just optionally derive this transform from the layer transform, without having to pass in any other state. We have to make sure we only conditionally use it, as not all glyphs will be pre-transformed. To that end, I made TextShader a replacement for PrimitiveShader (as discussed with Glenn).

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/2058)
<!-- Reviewable:end -->
@lsalzman
Copy link
Contributor

@lsalzman lsalzman commented Nov 23, 2017

This is fixed by PR #2058 with followup in PR #2094 .

@glennw glennw closed this Nov 23, 2017
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
6 participants
You can’t perform that action at this time.