Skip to content

Conversation

glennw
Copy link
Member

@glennw glennw commented Sep 18, 2017

Simplify the quantization function, and add unit tests.

Modify the shader to correctly add the glyph subpixel offset
before truncating the value.

With these changes, the glyph rendering is pixel-perfect with
Gecko in all the test cases I checked.

Fixes #1270.


This change is Reviewable

Simplify the quantization function, and add unit tests.

Modify the shader to correctly add the glyph subpixel offset
before truncating the value.

With these changes, the glyph rendering is pixel-perfect with
Gecko in all the test cases I checked.

Fixes servo#1270.
@glennw
Copy link
Member Author

glennw commented Sep 18, 2017

assert_eq!(rm.subpixel_quantize_offset(0.0), SubpixelOffset::Zero);
assert_eq!(rm.subpixel_quantize_offset(-0.0), SubpixelOffset::Zero);

assert_eq!(rm.subpixel_quantize_offset(0.1), SubpixelOffset::Zero);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: could be nicer if those subpixel_quantize_offset calls are batched per expected SubpixelOffset

@kvark
Copy link
Member

kvark commented Sep 18, 2017

Tests are green, merging.
@bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit ec26fb9 has been approved by kvark

@bors-servo
Copy link
Contributor

⌛ Testing commit ec26fb9 with merge c941796...

bors-servo pushed a commit that referenced this pull request Sep 18, 2017
Make subpixel positioning match that of Gecko.

Simplify the quantization function, and add unit tests.

Modify the shader to correctly add the glyph subpixel offset
before truncating the value.

With these changes, the glyph rendering is pixel-perfect with
Gecko in all the test cases I checked.

Fixes #1270.

<!-- 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/1715)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

☀️ Test successful - status-travis
Approved by: kvark
Pushing c941796 to master...

@bors-servo bors-servo merged commit ec26fb9 into servo:master Sep 19, 2017
@glennw glennw deleted the fix-subpx branch September 19, 2017 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants