Skip to content
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

Merged
merged 1 commit into from Jul 27, 2017
Merged

Multi-doc support #1509

merged 1 commit into from Jul 27, 2017

Conversation

kvark
Copy link
Member

@kvark kvark commented Jul 22, 2017

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.


This change is Reviewable

@glennw
Copy link
Member

glennw commented Jul 24, 2017

Reviewed 21 of 21 files at r1.
Review status: all files reviewed at latest revision, 4 unresolved discussions, some commit checks failed.


webrender/src/lib.rs, line 16 at r1 (raw file):

//! The main entry point to WebRender is the `webrender::renderer::Renderer`.
//!
//! By calling `Renderer::new(...)` you get a `Renderer`, as well as a `DocumentApiSender`.

It's not a DocumentApiSender you get from that?


webrender/src/lib.rs, line 19 at r1 (raw file):

//! Your `Renderer` is responsible to render the previously processed frames onto the screen.
//!
//! By calling `yourDocumentApiSenderInstance.create_api()`, you'll get a `DocumentApi` instance,

Same as above.


webrender/src/render_backend.rs, line 123 at r1 (raw file):

    frame_config: FrameBuilderConfig,
    documents: HashMap<DocumentId, Document>,

Let's use Fnv hasher here.


wrench/src/json_frame_writer.rs, line 73 at r1 (raw file):

    }

    pub fn begin_write_display_list(&mut self,

I wonder if we should just remove the json from writer completely? I don't think anyone uses it...


Comments from Reviewable

@glennw
Copy link
Member

glennw commented Jul 24, 2017

Looks great! Just a few minor comments / changes.

@glennw
Copy link
Member

glennw commented Jul 24, 2017

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.

@kvark kvark force-pushed the document branch 2 times, most recently from 03419a0 to b89b0e5 Compare July 24, 2017 14:37
@nical
Copy link
Contributor

nical commented Jul 24, 2017

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.

@nical
Copy link
Contributor

nical commented Jul 24, 2017

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).

@kvark kvark force-pushed the document branch 2 times, most recently from 9b09cc8 to 1969102 Compare July 24, 2017 19:07
@kvark
Copy link
Member Author

kvark commented Jul 24, 2017

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…

It's not a DocumentApiSender you get from that?

fixed


webrender/src/lib.rs, line 19 at r1 (raw file):

Previously, glennw (Glenn Watson) wrote…

Same as above.

fixed


webrender/src/render_backend.rs, line 123 at r1 (raw file):

Previously, glennw (Glenn Watson) wrote…

Let's use Fnv hasher here.

fixed


wrench/src/json_frame_writer.rs, line 73 at r1 (raw file):

Previously, glennw (Glenn Watson) wrote…

I wonder if we should just remove the json from writer completely? I don't think anyone uses it...

agreed, but better left for a dedicated PR


Comments from Reviewable

@jrmuizel
Copy link
Collaborator

Previously, glennw (Glenn Watson) wrote…

I wonder if we should just remove the json from writer completely? I don't think anyone uses it...

It's been used for getting readable dumps of binary recordings. I think we could probably simplify it to just providing that functionality.

@bors-servo
Copy link
Contributor

☔ The latest upstream changes (presumably #1512) made this pull request unmergeable. Please resolve the merge conflicts.

@bors-servo
Copy link
Contributor

☔ The latest upstream changes (presumably #1515) made this pull request unmergeable. Please resolve the merge conflicts.

@kvark kvark force-pushed the document branch 2 times, most recently from 3d0bde5 to 562f521 Compare July 26, 2017 16:59
@bors-servo
Copy link
Contributor

☔ The latest upstream changes (presumably #1523) made this pull request unmergeable. Please resolve the merge conflicts.

@kvark
Copy link
Member Author

kvark commented Jul 26, 2017

@glennw servo update is in kvark/servo@a6e54c9

@glennw
Copy link
Member

glennw commented Jul 27, 2017

Reviewed 21 of 21 files at r2.
Review status: all files reviewed at latest revision, 4 unresolved discussions.


Comments from Reviewable

@glennw glennw self-requested a review July 27, 2017 01:44
Copy link
Member

@glennw glennw left a 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.

@bors-servo
Copy link
Contributor

☔ The latest upstream changes (presumably #1522) made this pull request unmergeable. Please resolve the merge conflicts.

@kvark
Copy link
Member Author

kvark commented Jul 27, 2017

Rebasing this is a constant pain...
@bors-servo r=glennw

@bors-servo
Copy link
Contributor

📌 Commit f6d81d9 has been approved by glennw

@bors-servo
Copy link
Contributor

⌛ Testing commit f6d81d9 with merge 97af583...

bors-servo pushed a commit that referenced this pull request Jul 27, 2017
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 -->
@bors-servo
Copy link
Contributor

☀️ Test successful - status-travis
Approved by: glennw
Pushing 97af583 to master...

@bors-servo bors-servo merged commit f6d81d9 into servo:master Jul 27, 2017
@kvark kvark deleted the document branch July 27, 2017 17:00
@kvark kvark mentioned this pull request Jul 27, 2017
5 tasks
bors-servo pushed a commit to servo/servo that referenced this pull request Jul 27, 2017
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 -->
bors-servo pushed a commit to servo/servo that referenced this pull request Jul 28, 2017
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 -->
bors-servo pushed a commit to servo/servo that referenced this pull request Jul 28, 2017
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 -->
@kvark kvark mentioned this pull request Jul 28, 2017
bors-servo pushed a commit that referenced this pull request Jul 28, 2017
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 -->
bors-servo pushed a commit to servo/servo that referenced this pull request Jul 28, 2017
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 -->
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Jul 30, 2017
<!-- 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
luke-chang pushed a commit to luke-chang/gecko that referenced this pull request Jul 30, 2017
<!-- 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
aethanyc pushed a commit to aethanyc/gecko-dev that referenced this pull request Jul 31, 2017
<!-- 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
JerryShih pushed a commit to JerryShih/gecko-dev that referenced this pull request Aug 1, 2017
<!-- 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
staktrace added a commit to staktrace/webrender that referenced this pull request Aug 4, 2017
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.
bors-servo pushed a commit that referenced this pull request Aug 4, 2017
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.
@sotaroikeda
Copy link
Contributor

@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!

@kvark
Copy link
Member Author

kvark commented Aug 14, 2017

@sotaroikeda the idea is that WR can have multiple Renderer instances sharing the same backend and receiving frames only from the corresponding documents.

@sotaroikeda
Copy link
Contributor

@nical, do you have any ideas to use Multi-doc support in gecko?

@nical
Copy link
Contributor

nical commented Aug 25, 2017

@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.

Is it still in the middle of implementation?

Yes, as far as I can tell (it doesn't let you have a renderer per document yet for example).

@kvark
Copy link
Member Author

kvark commented Aug 25, 2017

Basically,

//TODO: associate `document_id` with target window

bors-servo pushed a commit that referenced this pull request Nov 21, 2017
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 -->
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Oct 1, 2019
<!-- 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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Oct 1, 2019
<!-- 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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Oct 1, 2019
<!-- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants