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

Garbled rendering of transformed content #427

Closed
jrmuizel opened this issue Oct 4, 2016 · 5 comments
Closed

Garbled rendering of transformed content #427

jrmuizel opened this issue Oct 4, 2016 · 5 comments

Comments

@jrmuizel
Copy link
Contributor

@jrmuizel jrmuizel commented Oct 4, 2016

@glennw
Copy link
Member

@glennw glennw commented Oct 5, 2016

#431 fixes the text being garbled. However, we need to add support for transformed clip rects to close this bug completely - I'll try to work on that in the next week or two.

@kvark
Copy link
Member

@kvark kvark commented Oct 25, 2016

Looking into this...

@kvark
Copy link
Member

@kvark kvark commented Oct 25, 2016

garbled_text

@kvark
Copy link
Member

@kvark kvark commented Oct 25, 2016

Interestingly, if I disable the WR_FEATURE_TRANSFORM paths in the text_run shaders, it renders better:
text-comparison
The layout seems to differ a bit with Firefox, and the font is smaller. Also, there are thin lines visible on the tile boundaries (I assume).

bors-servo added a commit that referenced this issue Oct 25, 2016
Fixed a number of smoothstep() UB cases in the shaders

Fixed the red rectangle in #427, but the text is still broken (to be addressed later).
The change is similar to b89ecd1, now all `smoothstep` calls should be correct.

<!-- 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/474)
<!-- Reviewable:end -->
@kvark
Copy link
Member

@kvark kvark commented Oct 28, 2016

Got it almost fixed now with WR_FEATURE_TRANSFORM:
textrun-update

There is some stuff missing at the end of the lines, not sure if because of rendering or not. Will investigate and file a PR for what I got regardless.

bors-servo added a commit that referenced this issue Oct 30, 2016
Text transformation fixes

Fixes #427  well, mostly...
Looks like the transformed clips (#498) need to be implemented for this to work fully correct.

Also adds a bit of comments to GLSL code to understand what's going on (please check if I misunderstood stuff and documented it wrong!).

The errors spotted:
  1. `layer.screen_vertices` was fetched with wrong indices
  2. `untransform` would use undefined value of `t` if the layer plane is perpendicular to the view
  3. text vertex shaders were missing a division by `vi.local_pos.z` for the layer coordinates
  4. `prim.local_rect` was used for the text_run local rectangle, instead of `local_rect`

<!-- 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/497)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Oct 31, 2016
Local rectangle clipping for transformed primitives

Finishes #427 implementation, now the text is cut evenly and not aligned to tile borders.
Also refactored `build_bounding_rect()` as well as a bit of `assign_prims_to_screen_tiles()`.

![textrun-comparison3](https://cloud.githubusercontent.com/assets/107301/19860234/5ce0c85a-9f5e-11e6-82f2-d72f19e4641a.png)

<!-- 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/502)
<!-- Reviewable:end -->
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
3 participants
You can’t perform that action at this time.