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 upEmbed PrimitiveMetadata inside Primitive struct. #2965
Conversation
|
r? @kvark This looks like a big PR, but most of it is just moving methods around as a result of the first commit. I tried to separate each method change into a single commit to make it easier to review. Try run here: There's a few orange items, but I think they are all unrelated - probably best to take a quick look to make sure though. |
|
There is a ton of things moved around, making it difficult to review. But overall I believe the changes are straightforward and improving our code.
webrender/src/batch.rs, line 1573 at r1 (raw file):
glad to see this going away :) webrender/src/picture.rs, line 225 at r1 (raw file):
re-assigning the runs here goes across the name of the method, need to think of a better name webrender/src/prim_store.rs, line 1196 at r1 (raw file):
Would be nice to make this more consistent: either webrender/src/prim_store.rs, line 1201 at r1 (raw file):
I'm a tiny bit worried that putting those together (as in - going with array of structures versus structure of arrays) would hurt our data locality. webrender/src/prim_store.rs, line 1207 at r1 (raw file):
nit: could do in a single match: webrender/src/prim_store.rs, line 1442 at r1 (raw file):
Sounds like we can move it into the match arm and call an webrender/src/prim_store.rs, line 2640 at r2 (raw file):
eh, it's hard to review this function since it's moved webrender/src/prim_store.rs, line 2348 at r5 (raw file):
a bit strange now that this function requires the primitive index webrender/src/prim_store.rs, line 2377 at r5 (raw file):
nit: extra line? webrender/src/prim_store.rs, line 2388 at r5 (raw file):
we need to refactor this match arm in the future, it has too much logic webrender/src/prim_store.rs, line 2722 at r7 (raw file):
nit: can combine in a single |
|
@gw3583 feel free to r=me if having no desire to address the nits :) |
|
|
webrender/src/batch.rs, line 1573 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Done. webrender/src/picture.rs, line 225 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Done. webrender/src/prim_store.rs, line 1196 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Done. webrender/src/prim_store.rs, line 1201 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
It's possible - we don't do a huge amount of work that operates only on one struct and not the other. But it's something we could reconsider after profiling when the prims are embedded in the picture structs. webrender/src/prim_store.rs, line 1207 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Done webrender/src/prim_store.rs, line 1442 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
We have a mutable borrow on a different primitive in that array inside the match. webrender/src/prim_store.rs, line 2640 at r2 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
It's the same functionality, just with more self :) webrender/src/prim_store.rs, line 2348 at r5 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Yea - it's used as part of the cache key for pictures. Not ideal, but needed for now. webrender/src/prim_store.rs, line 2377 at r5 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Done webrender/src/prim_store.rs, line 2388 at r5 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Agreed webrender/src/prim_store.rs, line 2722 at r7 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Done |
|
Addressed all comments. Merging now since this is prone to rebase issues. @bors-servo r=kvark |
|
|
Embed PrimitiveMetadata inside Primitive struct. This is another small step to moving primitives to be stored inside Picture structs, which will simplify some of the picture caching work. While making that change, I also tidied up some of the prim_store code by moving several of the methods into the Primitive struct. I've done each of these as a separate commit to make it easier to review. There's no functional changes here - just moving code around to make the picture caching work easier. There's also quite a few array indexing operations removed, which might be a small performance win. <!-- 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/2965) <!-- Reviewable:end -->
|
|
gw3583 commentedAug 10, 2018
•
edited by larsbergstrom
This is another small step to moving primitives to be stored inside Picture structs, which will simplify some of the picture caching work.
While making that change, I also tidied up some of the prim_store code by moving several of the methods into the Primitive struct. I've done each of these as a separate commit to make it easier to review.
There's no functional changes here - just moving code around to make the picture caching work easier. There's also quite a few array indexing operations removed, which might be a small performance win.
This change is