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 upSwitch box-shadows to use brush masks (and add basic brush prim). #1841
Conversation
|
r? @kvark There's a couple of blockers before this can be merged - but it can probably be reviewed now. The main issue is that the clip mask shader used for fast path box shadows (with zero blur) introduces a faint line of AA in some cases where it shouldn't. I'm a little unsure if I should leave this here until @nical finishes up his work on the AA changes, which may just resolve that problem. That causes a few test failures in the Servo WPT suite. @nical Do you think your AA work is likely to fix that, and how soon do you think it will be ready? |
ddf3e56
to
718901a
|
Reviewed 30 of 30 files at r1. webrender/res/brush.glsl, line 63 at r1 (raw file):
I'm concerned that this makes webrender/res/cs_text_run.glsl, line 23 at r1 (raw file):
nit: comment still implies the shadow webrender/res/ellipse.glsl, line 70 at r1 (raw file):
nit: would be nicer with the new formatting style webrender/res/ps_cache_image.glsl, line 68 at r1 (raw file):
I guess this will now become easier as @mstange convinced us to use multiplication ;) webrender/res/ps_line.glsl, line 102 at r1 (raw file):
should webrender/src/frame_builder.rs, line 1330 at r1 (raw file):
Shouldn't this be webrender/src/frame_builder.rs, line 1341 at r1 (raw file):
webrender/src/frame_builder.rs, line 1431 at r1 (raw file):
similarly, this could possibly be moved out of the Comments from Reviewable |
|
Review status: 26 of 30 files reviewed at latest revision, 8 unresolved discussions. webrender/res/brush.glsl, line 63 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Now that I look at this again, I'm not sure it correctly accounts for multiple text shadows with different offsets. I'll take a detailed look in the morning and either explain further with more comments, or fix if incorrect. webrender/res/cs_text_run.glsl, line 23 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Done. webrender/res/ellipse.glsl, line 70 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Done. webrender/res/ps_line.glsl, line 102 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Done. webrender/src/frame_builder.rs, line 1330 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
I think ClipOut is named somewhat confusingly - it is the opposite of Clip (that is, it allows pixels outside the specific region). webrender/src/frame_builder.rs, line 1341 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Done. webrender/src/frame_builder.rs, line 1431 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Done. Comments from Reviewable |
|
@kvark Thanks for the review! I've addressed most of those comments. The remaining issues blocking this are:
|
| vec2(1.0, -1.0), | ||
| afwidth); | ||
|
|
||
| return smoothstep(0.0, afwidth, 1.0 - current_distance); |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
glennw
Oct 13, 2017
Author
Member
Yes, the patch in #1822 fixes the test failures in this patch - it's due to the change in init_transform_fs.
This comment has been minimized.
This comment has been minimized.
|
|
|
|
|
I've rebased this over the AA change from @nical. Gecko try run is here: There are 6 new passes, and 6 new fails. It's likely some of these are related to other recent changes in WR (I don't think the fuzziness has been updated for the AA patch yet). I'll do some further investigation on those failures and see if they are fuzziness issues or bugs that need to be resolved before landing this. |
|
Looking at the unexpected passes / fails: Probably related to @gankro 's text-shadow change: Probably related to @nical 's AA change: New box-shadow PASS from this patch: New box-shadow FAIL from this patch: None of those box-shadow fails looks drastically wrong, but some of them have more fuzziness than I would expect to need (although most of them have fuzziness on skia / d2d too). I'll investigate some of those now. |
|
Can confirm those two passes are what I was targeting with my patch. |
152cdef
to
65d6ba7
This introduces a new brush primitive type. Right now, this is extremely basic and doesn't provide much new functionality. As more items are ported to use it, the functionality of the brush shader type will expand (mostly the VS parts). The major change in this patch is to remove the old box-shadow shader and switch box shadows to be drawn via a brush mask + gaussian blur approach. This *is* a performance regression for small / simple box shadows compared to previously, but this is only temporary. The goal of this (large) patch is to switch over to a different box-shadow technique and address correctness issues first, and then we can apply a number of optimizations on top of that. It *is* a performance win on very large box shadows, which was the performance worst case for the previous box shadow shader. The changes included: * Extend blur shader to support both A8 and RGBA8 blurs. * Basic brush shader and primitive code. * Brush mask shader. * Remove old box shadow shader. * Move some common clip functions to ellipse.glsl. * Extend cache image shader to support both A8 and RGBA8 sources. * Support clip masks in cache image shader. * Remove box shadow primitive type. * Add reftests for spread, offset, blur, border radius box-shadow variations. * Support adjusting the border radii of box shadows as defined by spec. Next steps: * Extend the mask shader to support arbitrary border radii per corner. * Apply various optimizations to the brush and blur code.
|
New try run: https://hg.mozilla.org/try/rev/007c2de84545170b1b25b627c8a0149d6cff5350 New PASSes related to this change: New FAILs related to this change: Test differences unrelated to this change: @staktrace @nical @kvark Given the above, I think this is probably ready to go now. Are you happy with the fuzziness changes described above? |
|
@glennw I agree with your reftest analysis and am fine with this landing. Thanks for doing the try push! |
|
Also for future reference, if you look at the most recent try runs in the wr-future-update bug the links to try pushes there will show which reftest differences were caused by stuff already landed and that I'm aware of. So in this case all the unrelated reftest failures that you were seeing I already have patches to adjust the fuzziness for. |
|
@staktrace @glennw thanks for being extremely cautious here! |
|
|
Switch box-shadows to use brush masks (and add basic brush prim). This introduces a new brush primitive type. Right now, this is extremely basic and doesn't provide much new functionality. As more items are ported to use it, the functionality of the brush shader type will expand (mostly the VS parts). The major change in this patch is to remove the old box-shadow shader and switch box shadows to be drawn via a brush mask + gaussian blur approach. This *is* a performance regression for small / simple box shadows compared to previously, but this is only temporary. The goal of this (large) patch is to switch over to a different box-shadow technique and address correctness issues first, and then we can apply a number of optimizations on top of that. It *is* a performance win on very large box shadows, which was the performance worst case for the previous box shadow shader. The changes included: * Extend blur shader to support both A8 and RGBA8 blurs. * Basic brush shader and primitive code. * Brush mask shader. * Remove old box shadow shader. * Move some common clip functions to ellipse.glsl. * Extend cache image shader to support both A8 and RGBA8 sources. * Support clip masks in cache image shader. * Remove box shadow primitive type. * Add reftests for spread, offset, blur, border radius box-shadow variations. * Support adjusting the border radii of box shadows as defined by spec. Next steps: * Extend the mask shader to support arbitrary border radii per corner. * Apply various optimizations to the brush and blur code. <!-- 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/1841) <!-- Reviewable:end -->
|
@staktrace A heads up - you need to update the bindings for this enum change - https://github.com/servo/webrender/pull/1841/files#diff-937670fa1a68b9bb7dab70622773f50d - otherwise, you get serde panics when sending a display list with box shadows. @jrmuizel Also a heads up - this does add a perf regression for box shadows. If you see large pink lines in the GPU profiler, don't worry, it's only temporary. I'll be working on the optimizations on top of this PR this week. |
|
|
5c3b489
into
servo:master
|
So in the try push that included this update the reftest results are slightly different. There was no change to
|
glennw commentedOct 10, 2017
•
edited by larsbergstrom
This introduces a new brush primitive type. Right now, this is
extremely basic and doesn't provide much new functionality. As
more items are ported to use it, the functionality of the brush
shader type will expand (mostly the VS parts).
The major change in this patch is to remove the old box-shadow
shader and switch box shadows to be drawn via a brush mask +
gaussian blur approach.
This is a performance regression for small / simple box shadows
compared to previously, but this is only temporary. The goal of
this (large) patch is to switch over to a different box-shadow
technique and address correctness issues first, and then we can
apply a number of optimizations on top of that. It is a performance
win on very large box shadows, which was the performance worst
case for the previous box shadow shader.
The changes included:
Next steps:
This change is