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

Pixel snapping with a stretch #1279

Closed
kvark opened this issue May 19, 2017 · 2 comments
Closed

Pixel snapping with a stretch #1279

kvark opened this issue May 19, 2017 · 2 comments
Assignees

Comments

@kvark
Copy link
Member

@kvark kvark commented May 19, 2017

We currently pass a single reference point into the primitive's vertex shader, based on which the snapping offset is computed for the whole primitive. That's not exactly how Gecko/Safari do the snapping. We should be snapping both left and right (correspondingly, top and bottom) of a primitive, potentially even stretching it.

@jrmuizel jrmuizel mentioned this issue May 19, 2017
20 of 24 tasks complete
@Gankra
Copy link
Contributor

@Gankra Gankra commented May 19, 2017

Some relevant tests in gecko:

  • layout/reftests/pixel-rounding/border-width-5.html == layout/reftests/pixel-rounding/border-width-10-ref.html
  • layout/reftests/pagination/abspos-overflow-01-cols.xhtml == layout/reftests/pagination/abspos-overflow-01-cols.ref.xhtml
  • layout/reftests/pagination/dynamic-abspos-overflow-01-cols.xhtml == layout/reftests/pagination/dynamic-abspos-overflow-01-cols.ref.xhtml

All of these have a missing column of pixels on the right, because the width on that pixel is 0.5, which the rasterizer happens to decide means that pixel isn't part of the shape.

@nical
Copy link
Collaborator

@nical nical commented May 20, 2017

Also, we need the snapping information (the two corners) to be independent of the rect of the primitive, otherwise tiled primitives often render incorrectly (1 pixel band between two tiles of the same image) because each tile get snapped independently. Or perhaps the stretching will prevent this bug?

@kvark kvark self-assigned this May 23, 2017
@kvark kvark mentioned this issue May 24, 2017
3 of 3 tasks complete
bors-servo added a commit that referenced this issue May 26, 2017
Full rectangular pixel snapping

Fixes #1279
r? @glennw

WIP TODOs:
- [x] test servo WPT reftests
- [x] add local snapping tests
- [x] cover `write_transform_vertex`

<!-- 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/1292)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue May 26, 2017
Full rectangular pixel snapping

Fixes #1279
r? @glennw

WIP TODOs:
- [x] test servo WPT reftests
- [x] add local snapping tests
- [x] cover `write_transform_vertex`

<!-- 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/1292)
<!-- 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.