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 border corners with differing styles. #1199
Conversation
|
r? @kvark |
|
Looks good! |
| @@ -95,14 +123,16 @@ void main(void) { | |||
| color1 = border.colors[1]; | |||
| vClipCenter = corners.tl_outer + border.radii[0].xy; | |||
| vClipSign = vec2(1.0); | |||
| set_radii(border.style.x, | |||
| style = select_style(prim.user_data.x, border.style.y, border.style.x); | |||
This comment has been minimized.
This comment has been minimized.
| border.radii[0].zw, | ||
| border.widths.zy, | ||
| adjusted_widths.zy); | ||
| set_edge_line(border.widths.zy, | ||
| corners.tr_outer, | ||
| vec2(-1.0, 1.0)); | ||
| style = int(border.style.y); | ||
| edge_distances = vec4(p1.x - adjusted_widths.z, | ||
| p0.y + adjusted_widths.y, | ||
| p1.x - border.widths.z + adjusted_widths.z, |
This comment has been minimized.
This comment has been minimized.
| border.radii[1].xy, | ||
| border.widths.zw, | ||
| adjusted_widths.zw); | ||
| set_edge_line(border.widths.zw, | ||
| corners.br_outer, | ||
| vec2(-1.0, -1.0)); | ||
| style = int(border.style.z); | ||
| edge_distances = vec4(p1.x - adjusted_widths.z, | ||
| p1.y - adjusted_widths.w, | ||
| p1.x - border.widths.z + adjusted_widths.z, |
This comment has been minimized.
This comment has been minimized.
kvark
May 4, 2017
Member
similarly, this could use inv_adjusted_widths, even in a vectorized (short) form
| batch.add_instance(base_instance.build(border_segment, 0, 0)); | ||
| for (i, instance_kind) in border_cpu.corner_instances.iter().enumerate() { | ||
| let sub_index = i as i32; | ||
| match *instance_kind { |
This comment has been minimized.
This comment has been minimized.
kvark
May 4, 2017
Member
nit: this match could be simplified if it only returned &[BorderCornerSide]
This handles all border corners styles except those with dashed and/or dotted styles. Those require changes to the border clip mask shader, which will be done in a follow up. The basic idea is to draw the corner twice, once for each style and mask out the other side of the corner. This results in more pixels being drawn than necessary, and can sometimes result in the AA between the corner segments being slightly incorrect. Those issues can be fixed at a later time.
|
@kvark Thanks - fixed the @bors-servo r=kvark |
|
|
Support border corners with differing styles. This handles all border corners styles except those with dashed and/or dotted styles. Those require changes to the border clip mask shader, which will be done in a follow up. The basic idea is to draw the corner twice, once for each style and mask out the other side of the corner. This results in more pixels being drawn than necessary, and can sometimes result in the AA between the corner segments being slightly incorrect. Those issues can be fixed at a later time. <!-- 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/1199) <!-- Reviewable:end -->
|
|
|
@glennw I think this patch does actually trigger all those test failures in the gecko try push we were talking about yesterday (tracked in bug 1363683). It looks like possibly an infinite loop somewhere inside the render function - or at least something that causes the render function take upwards of 5 minutes to run, at which point the timeout kills the test. I was able to reproduce locally on the gecko |
|
@staktrace that is worrisome... I re-inspected the code and didn't see a potential cause of endless loops. Perhaps, the hang/delay is coming from the driver or the hardware doesn't like the new code for some reason. I think we should back the PR out and try reproducing your case on Gecko locally. |
|
@staktrace @kvark Hmm, that backtrace does indeed suggest the shader change is causing some kind of issue inside llvmpipe. I'm guessing that the shader change has triggered a bug in mesa / llvmpipe :( |
|
@staktrace @kvark I will try to reproduce this locally on llvmpipe today. |
|
I imagine it will just be some tweak to the shader needed to avoid triggering the bug in mesa / llvm - hopefully. |
|
I reproduced this locally. It appears to be a bug in the shader compiler in mesa / llvm. I've opened a PR here #1242 which works around the hang by slightly tweaking the structure of the shader. It shouldn't have any functional effect, but fixes the problem for me. Is the simplest way to test this just to get it merged and try to do an update? |
|
If the PR can be applied (without too much rebasing) directly onto the copy of webrender in mozilla-central or graphics, that would be the best thing to push to try - that way we start from a known good revision and just test this change in isolation. However if it depends on other things that landed since the last WR update into gecko, or is otherwise problematic to rebase, then it's probably easiest to just get it merged and my next simulated WR update will test it. |
glennw commentedMay 4, 2017
•
edited by larsbergstrom
This handles all border corners styles except those with
dashed and/or dotted styles. Those require changes to the
border clip mask shader, which will be done in a follow up.
The basic idea is to draw the corner twice, once for each style
and mask out the other side of the corner. This results in more
pixels being drawn than necessary, and can sometimes result in the
AA between the corner segments being slightly incorrect. Those
issues can be fixed at a later time.
This change is