New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi-doc support #1509
Multi-doc support #1509
Conversation
Reviewed 21 of 21 files at r1. webrender/src/lib.rs, line 16 at r1 (raw file):
It's not a DocumentApiSender you get from that? webrender/src/lib.rs, line 19 at r1 (raw file):
Same as above. webrender/src/render_backend.rs, line 123 at r1 (raw file):
Let's use Fnv hasher here. wrench/src/json_frame_writer.rs, line 73 at r1 (raw file):
I wonder if we should just remove the json from writer completely? I don't think anyone uses it... Comments from Reviewable |
Looks great! Just a few minor comments / changes. |
Also, it'd be good to have the corresponding Servo patch ready to go when we land this so we can get a WR update landed straight after. |
03419a0
to
b89b0e5
Compare
The separation between the resource and document apis looks nice but it will make the task of bundling image updates and display lists in the same transactions difficult. |
I suggest not rushing to update servo and gecko, because if I manage to be convincing enough during tomorrow's meeting, we'll do something different (not totally different but with some substantial API changes). |
9b09cc8
to
1969102
Compare
Servo integration is not trivial, WIP, but other notes are addressed now. Review status: 12 of 21 files reviewed at latest revision, 4 unresolved discussions. webrender/src/lib.rs, line 16 at r1 (raw file): Previously, glennw (Glenn Watson) wrote…
fixed webrender/src/lib.rs, line 19 at r1 (raw file): Previously, glennw (Glenn Watson) wrote…
fixed webrender/src/render_backend.rs, line 123 at r1 (raw file): Previously, glennw (Glenn Watson) wrote…
fixed wrench/src/json_frame_writer.rs, line 73 at r1 (raw file): Previously, glennw (Glenn Watson) wrote…
agreed, but better left for a dedicated PR Comments from Reviewable |
Previously, glennw (Glenn Watson) wrote…
It's been used for getting readable dumps of binary recordings. I think we could probably simplify it to just providing that functionality. |
☔ The latest upstream changes (presumably #1512) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #1515) made this pull request unmergeable. Please resolve the merge conflicts. |
3d0bde5
to
562f521
Compare
☔ The latest upstream changes (presumably #1523) made this pull request unmergeable. Please resolve the merge conflicts. |
@glennw servo update is in kvark/servo@a6e54c9 |
Reviewed 21 of 21 files at r2. Comments from Reviewable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I'll leave for you to merge when ready, but r=me.
☔ The latest upstream changes (presumably #1522) made this pull request unmergeable. Please resolve the merge conflicts. |
Rebasing this is a constant pain... |
📌 Commit f6d81d9 has been approved by |
Multi-doc support A namespace can now contain multiple documents. Operations on a document are done ~~via a separate object `DocumentApi`, which created from `ResourceApi` that manages resources~~ by providing `DocumentId` parameter to `RenderApi` calls. This PR is a step towards #1357, also relates to #1370. <!-- 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/1509) <!-- Reviewable:end -->
☀️ Test successful - status-travis |
WR multi-document update <!-- Please describe your changes on the following line: --> The PR updates WR version to support multiple documents (servo/webrender#1509) but doesn't take advantage of this new feature yet. It also makes Servo to use `DevicePixel` from WR instead of rolling out another one. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because _____ no extra logic <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17892) <!-- Reviewable:end -->
WR multi-document update <!-- Please describe your changes on the following line: --> The PR updates WR version to support multiple documents (servo/webrender#1509) but doesn't take advantage of this new feature yet. It also makes Servo to use `DevicePixel` from WR instead of rolling out another one. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because _____ no extra logic <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17892) <!-- Reviewable:end -->
WR multi-document update <!-- Please describe your changes on the following line: --> The PR updates WR version to support multiple documents (servo/webrender#1509) but doesn't take advantage of this new feature yet. It also makes Servo to use `DevicePixel` from WR instead of rolling out another one. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because _____ no extra logic <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17892) <!-- Reviewable:end -->
WebGL encapsulation Refactors our WebGL usage and fixes a regression from #1509 also related to #1353 (should make it easier) r? @MortimerGoro cc @glennw <!-- 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/1530) <!-- Reviewable:end -->
WR multi-document update <!-- Please describe your changes on the following line: --> The PR updates WR version to support multiple documents (servo/webrender#1509) but doesn't take advantage of this new feature yet. It also makes Servo to use `DevicePixel` from WR instead of rolling out another one. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because _____ no extra logic <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17892) <!-- Reviewable:end -->
<!-- Please describe your changes on the following line: --> The PR updates WR version to support multiple documents (servo/webrender#1509) but doesn't take advantage of this new feature yet. It also makes Servo to use `DevicePixel` from WR instead of rolling out another one. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because _____ no extra logic <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 12a49dc0be8a8acd12440dd7191b349ca17de7c8 --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : f036e78668713987f000f99714f86e588107baa1
<!-- Please describe your changes on the following line: --> The PR updates WR version to support multiple documents (servo/webrender#1509) but doesn't take advantage of this new feature yet. It also makes Servo to use `DevicePixel` from WR instead of rolling out another one. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because _____ no extra logic <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 12a49dc0be8a8acd12440dd7191b349ca17de7c8
<!-- Please describe your changes on the following line: --> The PR updates WR version to support multiple documents (servo/webrender#1509) but doesn't take advantage of this new feature yet. It also makes Servo to use `DevicePixel` from WR instead of rolling out another one. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because _____ no extra logic <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 12a49dc0be8a8acd12440dd7191b349ca17de7c8
<!-- Please describe your changes on the following line: --> The PR updates WR version to support multiple documents (servo/webrender#1509) but doesn't take advantage of this new feature yet. It also makes Servo to use `DevicePixel` from WR instead of rolling out another one. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because _____ no extra logic <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 12a49dc0be8a8acd12440dd7191b349ca17de7c8
As a result of the multi-document changes in servo#1509, it is necessary for Gecko to stop just inventing its own namespace ids and instead use ones that match what WR is using internally. Therefore it is necessary for the RenderApi to expose the namespace id.
Expose the namespace id from RenderApi As a result of the multi-document changes in #1509, it is necessary for Gecko to stop just inventing its own namespace ids and instead use ones that match what WR is using internally. Therefore it is necessary for the RenderApi to expose the namespace id.
@kvark, can you explain about actual benefit of supporting Multi-doc support? Is it still in the middle of implementation? Gecko creates GL context for each window, but webrender Renderer instance still owns single GL context, therefore each window needs to have different Renderer instance. Then current gecko just use one document on each Renderer and each window creates each webrender Renderer by Bug 1385003 Thanks! |
@sotaroikeda the idea is that WR can have multiple Renderer instances sharing the same backend and receiving frames only from the corresponding documents. |
@nical, do you have any ideas to use Multi-doc support in gecko? |
I haven't looked into the details since the multi-doc stuff landed, but I think that it'd be good to complete the implementation so that documents can use their own renderer. That way we can look into grouping some windows like tooltips into using a single render backend thread, and share fonts, glyph cache, etc.
Yes, as far as I can tell (it doesn't let you have a renderer per document yet for example). |
Basically, webrender/webrender/src/renderer.rs Line 1455 in 2ac2da0
|
DocumentAPI support on the Renderer side This is a second batch of changes related to Document API, following #1509. The idea is to allow Gecko to have separate documents for the chrome UI, page content, and bottom status bar, as opposed to using different pipelines in the same document. This change would allow minimal scene rebuilds per frame when UI is affected. WIP TODO: - [x] strict ordering API: 532bff5 - [x] Servo patch and test runs: kvark/servo@0263fa8 - [x] Firefox patch and try push: https://treeherder.mozilla.org/#/jobs?repo=try&revision=f939fbdab0231e6328061c12903db0c45847dd18 - ~~`box-shadow/boxshadow-skiprect.html`~~ (from #1943) - ~~`css-filter-chains/moz-element.html`~~ (same as in #2053) - ~~`transform/animate-layer-scale-inherit-1.html`~~ (from #2043) - [x] example - [x] `FrameBuilder` and `RenderedDocument` refactor https://tools.taskcluster.net/groups/DEvThfCaQWmt5Hp806GDLg/tasks/VLCZI7hVTQCc1xrDR3PgOQ/details# - [x] review comments cc @glennw @mstange @jrmuizel <!-- 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/2050) <!-- Reviewable:end -->
<!-- Please describe your changes on the following line: --> The PR updates WR version to support multiple documents (servo/webrender#1509) but doesn't take advantage of this new feature yet. It also makes Servo to use `DevicePixel` from WR instead of rolling out another one. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because _____ no extra logic <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 12a49dc0be8a8acd12440dd7191b349ca17de7c8 UltraBlame original commit: c424ad1c5f9441f43f3f792d853170f3fd8216e9
<!-- Please describe your changes on the following line: --> The PR updates WR version to support multiple documents (servo/webrender#1509) but doesn't take advantage of this new feature yet. It also makes Servo to use `DevicePixel` from WR instead of rolling out another one. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because _____ no extra logic <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 12a49dc0be8a8acd12440dd7191b349ca17de7c8 UltraBlame original commit: c424ad1c5f9441f43f3f792d853170f3fd8216e9
<!-- Please describe your changes on the following line: --> The PR updates WR version to support multiple documents (servo/webrender#1509) but doesn't take advantage of this new feature yet. It also makes Servo to use `DevicePixel` from WR instead of rolling out another one. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because _____ no extra logic <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 12a49dc0be8a8acd12440dd7191b349ca17de7c8 UltraBlame original commit: c424ad1c5f9441f43f3f792d853170f3fd8216e9
A namespace can now contain multiple documents. Operations on a document are done
via a separate objectby providingDocumentApi
, which created fromResourceApi
that manages resourcesDocumentId
parameter toRenderApi
calls.This PR is a step towards #1357, also relates to #1370.
This change is