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 upFlattening refactor #1942
Flattening refactor #1942
Conversation
|
Do we need a gecko try for this, or does it involve no functional changes? |
|
No functional change is expected here. I believe local tests are sufficient. |
|
Reviewed 3 of 3 files at r1. Comments from Reviewable |
|
@kvark This looks fine to me. It will be interesting to see if reading the RWLock on each text run ever shows up in a profile (I don't think it will). I'm not super keen on the I'll leave it to you if you want to do a gecko try run, this seems fairly straightforward though, so r=me. Thanks! |
|
@kvark I guess having FontInstanceMap as a RWLock can introduce race conditions if someone updates the font instances while a DL is processing (e.g. some text runs may end up not finding the font instance, and other ones in the same DL will). I don't think it's a big deal - since it can only happen if you're using the API incorrectly. If we did ever run into perf issues reading the RW lock, or wanted to avoid races, we could probably instead clone the FontInstanceMap once at the start of each job. |
|
@glennw thanks for feedback!
I'll rename it back.
Yes. Not sure how else we can provide this font instance data.
My understanding was that it's going to be |
|
@bors-servo r+ |
|
|
Yeah we need to pipeline resource updates with scene building (any resource update coming after a scene must wait for that scene to be built) otherwise frame consistency would break. It should be fairly easy to do. |
Flattening refactor Warning: this would be difficult to review because of large amounts of moved code. Sorry! Changes: ~~ - (nit) renamed `FlattenContext` -> `Roller` to give it a little more flavor, given the `FrameContext` defined in the same file.~~ - detached flattening from resource cache by wrapping the font instance map in an `Arc` and passing it to the `FlattenContext` directly - (major) moved all the flattening logic from `FrameContext` into `FlattenContext` (oh, names...), which appears to have more sense to me architecturally, and allows to reduce the number of parameters we pass to flatten functions (see line count difference) This is one more step towards moving the scene building in a separate thread. Biggest things left are: - clip-scroll tree - scene cc @glennw @nical <!-- 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/1942) <!-- Reviewable:end -->
|
|
|
@kvark The latest WR update try push is showing a bunch of crashes, this PR is the most likely culprit in the regression range. I'm doing a try push to confirm but you might want a head start on seeing if there's any obvious problem. Details at bug 1410893 comment 9 onwards. |
|
@staktrace thanks for the heads up! this is unexpected. Looking now... |
Followup fix to update_image_template Follow-up to #1942, addressing #1942 (comment) r? @staktrace <!-- 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/1948) <!-- Reviewable:end -->
kvark commentedOct 25, 2017
•
edited
Warning: this would be difficult to review because of large amounts of moved code. Sorry!
Changes:
~~ - (nit) renamed
FlattenContext->Rollerto give it a little more flavor, given theFrameContextdefined in the same file.~~Arcand passing it to theFlattenContextdirectlyFrameContextintoFlattenContext(oh, names...), which appears to have more sense to me architecturally, and allows to reduce the number of parameters we pass to flatten functions (see line count difference)This is one more step towards moving the scene building in a separate thread. Biggest things left are:
cc @glennw @nical
This change is