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 upBe consistent about how the algorithm we use to modulate colors. #3010
Conversation
…tset borders. Just so we have a single way to define the coefficients that we use to darken / enlighten a color for these kinds of borders.
In particular, if the color is black, every browser does its best to infer the color. Fixes: https://bugzilla.mozilla.org/show_bug.cgi?id=1488294 This should require a couple test updates in Gecko I presume.
|
@emilio Could you do a try run and paste the link? |
|
https://treeherder.mozilla.org/#/jobs?repo=try&revision=85f6a936bf2a8512f87d25fded0a8c05db7cae88 is the try run. I expect a couple table tests will start failing, that's because right now we're painting both the test and the reference with black borders, which is wrong. Marking them as expected failures should be fine. They should be fixed over with the work from https://bugzilla.mozilla.org/show_bug.cgi?id=1487407. |
|
https://treeherder.mozilla.org/#/jobs?repo=try&revision=51c7f3991d72e4a2323706b3c2ad2433bc1cee85 should be a faster (but linux-only) try run. Edit: wrong link, has more patches below those. |
So, quick report on the failures... A bunch of the table-bordercollapse failures are expected, and should be progressions (before we should be rendering black borders instead of groove and co.). Most of the failures are single-pixel borders. I missed that Gecko has the condition that if it needs two colors for a border but doesn't have two pixels, it'll just render a solid border with the unmangled color. Can be seen in the following page: <!doctype html>
<style>
div {
border: 1px groove black;
}
</style>
<div style="border: 1px groove black">Should not have lighter border</div>
<div style="border: 10px groove black">Should have lighter border</div>The latest commit should address this. The failure in layout/reftests/bugs/186317-1.html is of the same nature. A bit more worrying is the failure in |
|
https://treeherder.mozilla.org/#/jobs?repo=try&revision=0e3afa2058fd3f1ed19af3a2fd9eec0e9e817704 is a more updated try run which should only include the bordercollapse failures and the sticky legend one. |
|
I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1488403 to fix the sticky legend reftest to not depend on the AA we do around the groove border, so assuming that gets accepted this should be green on try. I couldn't reproduce that failure locally, but I think I understand the root cause (see the patch there). We may want to represent groove borders as two different border segments to avoid doing distance AA across them, but it's not clear it's better to me, and in any case it's not the point of neither this change or the test. |
|
(or @nical, if you're familiar with this code) |
|
@bors-servo r+ |
|
|
Be consistent about how the algorithm we use to modulate colors. In particular, if the color is black, every browser does its best to infer the color. Fixes: https://bugzilla.mozilla.org/show_bug.cgi?id=1488294 This should require a couple test updates in Gecko I presume. <!-- 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/3010) <!-- Reviewable:end -->
|
|
| } | ||
|
|
||
| vec4[2] get_colors_for_side(vec4 color, int style) { | ||
| vec4 result[2]; | ||
| const vec2 f = vec2(1.3, 0.7); | ||
|
|
||
| bool is_black = color.rgb == vec3(0.0, 0.0, 0.0); |
This comment has been minimized.
This comment has been minimized.
kvark
Sep 4, 2018
Member
This may not be portable. IIRC, vector comparison produces vector of booleans. We should be using dot(color.rgb,color.rgb) or all(color.rgb == vec3(0.0, 0.0, 0.0))
This comment has been minimized.
This comment has been minimized.
nical
Sep 4, 2018
Collaborator
I could be wrong but I think that some_vec3 == other_vec3 returns a boolean in glsl and that the equal function returns a vector of boolean.
This comment has been minimized.
This comment has been minimized.
kvark
Sep 4, 2018
Member
Indeed. I just recalled a driver bug with those, hence my radar fired up the red light :)
This comment has been minimized.
This comment has been minimized.
kvark
Sep 5, 2018
Member
Also note the relevant record in our own driver bug treasury: https://github.com/servo/webrender/wiki/Driver-issues#1728-1368---shader-compiler-bug-when--is-used-inline-as-function-arg
…antialising. r=nical This reftest fails with my changes from servo/webrender#3010. I tried to debug locally but it passes here. The reason it fails is because WebRender does distance AA between the segments of a ridge / groove border, and there's a subpixel difference so we get the AA slightly different in the test. Gecko on the other hand represents these borders as different composed solid segments, so it can't have this problem, since it doesn't do AA across the segments. We may want to change that, but it's not clear to me it's wanted, since rounded corners for these look much better on WR, for example. Rather than fuzzing the test or something like that, make the test not rely on that, given it's testing the position of the legend. Differential Revision: https://phabricator.services.mozilla.com/D4934 --HG-- extra : moz-landing-system : lando
…antialising. r=nical This reftest fails with my changes from servo/webrender#3010. I tried to debug locally but it passes here. The reason it fails is because WebRender does distance AA between the segments of a ridge / groove border, and there's a subpixel difference so we get the AA slightly different in the test. Gecko on the other hand represents these borders as different composed solid segments, so it can't have this problem, since it doesn't do AA across the segments. We may want to change that, but it's not clear to me it's wanted, since rounded corners for these look much better on WR, for example. Rather than fuzzing the test or something like that, make the test not rely on that, given it's testing the position of the legend. Differential Revision: https://phabricator.services.mozilla.com/D4934
…antialising. r=nical This reftest fails with my changes from servo/webrender#3010. I tried to debug locally but it passes here. The reason it fails is because WebRender does distance AA between the segments of a ridge / groove border, and there's a subpixel difference so we get the AA slightly different in the test. Gecko on the other hand represents these borders as different composed solid segments, so it can't have this problem, since it doesn't do AA across the segments. We may want to change that, but it's not clear to me it's wanted, since rounded corners for these look much better on WR, for example. Rather than fuzzing the test or something like that, make the test not rely on that, given it's testing the position of the legend. Differential Revision: https://phabricator.services.mozilla.com/D4934 UltraBlame original commit: e4f3b85bc61bded27b7ddbdc18fea4ba55121d21
…antialising. r=nical This reftest fails with my changes from servo/webrender#3010. I tried to debug locally but it passes here. The reason it fails is because WebRender does distance AA between the segments of a ridge / groove border, and there's a subpixel difference so we get the AA slightly different in the test. Gecko on the other hand represents these borders as different composed solid segments, so it can't have this problem, since it doesn't do AA across the segments. We may want to change that, but it's not clear to me it's wanted, since rounded corners for these look much better on WR, for example. Rather than fuzzing the test or something like that, make the test not rely on that, given it's testing the position of the legend. Differential Revision: https://phabricator.services.mozilla.com/D4934 UltraBlame original commit: e4f3b85bc61bded27b7ddbdc18fea4ba55121d21
…antialising. r=nical This reftest fails with my changes from servo/webrender#3010. I tried to debug locally but it passes here. The reason it fails is because WebRender does distance AA between the segments of a ridge / groove border, and there's a subpixel difference so we get the AA slightly different in the test. Gecko on the other hand represents these borders as different composed solid segments, so it can't have this problem, since it doesn't do AA across the segments. We may want to change that, but it's not clear to me it's wanted, since rounded corners for these look much better on WR, for example. Rather than fuzzing the test or something like that, make the test not rely on that, given it's testing the position of the legend. Differential Revision: https://phabricator.services.mozilla.com/D4934 UltraBlame original commit: e4f3b85bc61bded27b7ddbdc18fea4ba55121d21
emilio commentedSep 3, 2018
•
edited by larsbergstrom
In particular, if the color is black, every browser does its best to infer the
color.
Fixes: https://bugzilla.mozilla.org/show_bug.cgi?id=1488294
This should require a couple test updates in Gecko I presume.
This change is