Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upsupport font subpixel AA with content transforms #2058
Conversation
|
Reviewed 9 of 9 files at r1. Comments from Reviewable |
|
This looks great! We'll need a gecko try run before merging though. I'll handle running it through the Servo tests. |
|
Oh, one other thing - we should add some wrench reftest cases - rotation, skew etc on both subpx and alpha test runs. Also with some text shadow cases. These can be done as a follow up. |
|
There's a few gecko try failures that @lsalzman is working on - we know the cause. |
|
Fixed issue with computing snap offsets in the text shader. |
|
I think we should have at least a couple of reftests (just on one platform is enough) for this stuff - it's so fiddly to get right and easy to regress. |
|
|
|
Fixed merge conflicts. |
|
|
|
Added subpixel rotation, scale, and skew transform reftests. |
|
Based on discussions with @lsalzman I think this is blocked until we get some fixes to the mac dependency crates. |
|
Fixed core-graphics-rs to have the functionality needed and updated this to use it. |
|
Reviewed 20 of 20 files at r2. Comments from Reviewable |
|
@lsalzman has done a try run and got green results, so this looks good to go. Thanks! @bors-servo r+ |
|
|
|
|
|
|
|
Needs a rebase. |
|
@bors-servo r+ |
|
|
|
@bors-servo r+ |
|
|
|
@bors-servo delegate |
|
@bors-servo delegate+ |
|
|
|
@bors-servo r+ |
|
|
|
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 -->
|
|
|
Fixes #1808 |
lsalzman commentedNov 18, 2017
•
edited by larsbergstrom
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).
This change is