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 upUse FastTransform almost everywhere #2444
Conversation
|
Gecko try job for this change is here: https://treeherder.mozilla.org/#/jobs?repo=try&revision=2f8bc89e36afa986e5f3ea8011caeec007b66cc9 The build failures seem to be unrelated infrastructure issues. |
|
Reviewed 8 of 8 files at r1. webrender/src/clip_scroll_node.rs, line 183 at r1 (raw file):
nit: could just be webrender/src/prim_store.rs, line 1475 at r1 (raw file):
nit: it could also just implement webrender/src/util.rs, line 157 at r1 (raw file):
nit: use the new alias here webrender/src/util.rs, line 347 at r1 (raw file):
we should be consistent in naming of those generic arguments webrender/src/util.rs, line 347 at r1 (raw file):
I don't think name like webrender/src/util.rs, line 349 at r1 (raw file):
I think this should use the destination space - makes it more convenient for the using code webrender/src/util.rs, line 358 at r1 (raw file):
is this comment needed? webrender/src/util.rs, line 371 at r1 (raw file):
doesn't look to be consistent with webrender/src/util.rs, line 380 at r1 (raw file):
could probably just implement webrender/src/util.rs, line 391 at r1 (raw file):
webrender/src/util.rs, line 402 at r1 (raw file):
nit: could also do webrender/src/util.rs, line 407 at r1 (raw file):
is it desirable to re-compute the inverse during each step of transformations like this one? webrender/src/util.rs, line 417 at r1 (raw file):
similarly, we probably want webrender/src/util.rs, line 442 at r1 (raw file):
I think this should be webrender/src/util.rs, line 483 at r1 (raw file):
not required for this PR, but I think Comments from Reviewable |
|
Review status: all files reviewed at latest revision, 15 unresolved discussions, some commit checks failed. webrender/src/clip_scroll_node.rs, line 183 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
I think LayoutTransformOrOffset::identity is a little more efficient here. webrender/src/prim_store.rs, line 1475 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Good idea! webrender/src/util.rs, line 157 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Nice catch. webrender/src/util.rs, line 347 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Also here. I had planned to fix this, but it got lost during the day. webrender/src/util.rs, line 347 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
I'm happy to rename this to FastTransform. webrender/src/util.rs, line 349 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
When it's an offset the webrender/src/util.rs, line 358 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
This was left over. I'll remove it. webrender/src/util.rs, line 371 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Fixed. webrender/src/util.rs, line 380 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Done. webrender/src/util.rs, line 391 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Done. webrender/src/util.rs, line 402 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
It's hard to say which version is more readable, but I think it's a bit easier to read without the angle brackets. webrender/src/util.rs, line 407 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
It's not necessary and we could specialize this even further, but I wanted to avoid premature optimization here. webrender/src/util.rs, line 417 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Done. webrender/src/util.rs, line 442 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Thanks! Fixed. webrender/src/util.rs, line 483 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Okay. That's a good change for the future. Comments from Reviewable |
e5d4864
to
8fe094e
|
@kvark Thanks for the excellent review. I think I have answered almost all of your concerns, but let me know if I missed anything. |
|
Thanks for addressing my concerns! We are almost there :) Reviewed 8 of 8 files at r2. webrender/src/clip_scroll_node.rs, line 183 at r1 (raw file): Previously, mrobinson (Martin Robinson) wrote…
this comment was about the line you changed to webrender/src/util.rs, line 371 at r1 (raw file): Previously, mrobinson (Martin Robinson) wrote…
do we still need the constructors though?.. webrender/src/util.rs, line 402 at r1 (raw file): Previously, mrobinson (Martin Robinson) wrote…
Sure, I don't hold strong feelings about this. Just seeing webrender/src/util.rs, line 115 at r2 (raw file):
I think this should come with Comments from Reviewable |
|
Review status: all files reviewed at latest revision, 4 unresolved discussions. webrender/src/util.rs, line 371 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
The constructors are still used in a couple places to avoid having to use explicitly specify the types in order to satisfy the type inference. I think it's better to be explicit in those cases rather than rely on the inference + writing the type. webrender/src/util.rs, line 115 at r2 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Okay. Fixed. Comments from Reviewable |
FastTransform used to be called TransformOrOffset and this change uses it in a lot of places that we used to use TypedTransform3D directly. This helps to avoid the cost of expensive matrix math and allows us to more liberally call things like `inverse()` on our transformations, since the worst case is that we will be retrieving the already-cached inverted matrix. This decreases the amount of time that FrameBuilder::build takes in my local CPU profiles.
8fe094e
to
8c3bf9c
|
@bors-servo r+ |
|
|
…, r=kvark Use FastTransform almost everywhere This helps to avoid the cost of expensive matrix math and allows us to more liberally call things like `inverse()` on our transformations, since the worst case is that we will be retrieving the already-cached inverted matrix. This decreases the amount of time that FrameBuilder::build takes in my local CPU profiles. <!-- 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/2444) <!-- Reviewable:end -->
|
|
mrobinson commentedFeb 20, 2018
•
edited by larsbergstrom
This helps to avoid the cost of expensive matrix math and allows us to
more liberally call things like
inverse()on our transformations,since the worst case is that we will be retrieving the already-cached
inverted matrix. This decreases the amount of time that
FrameBuilder::build takes in my local CPU profiles.
This change is