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 upDocumentAPI support on the Renderer side #2050
Conversation
|
|
|
The performance aspect here is difficult to get right, since it relies on a frame semantics change. Old logic used to clear everything if either requested, or the frame size is less than the viewport. The new logic is:
Thus, we may end up clearing twice with the new logic. I expect the WR client to be careful about the clear colors and don't specify both the framebuffer and document/frame clear color unless necessary. Aside from this aspect, the PR should be ready to review/merge now. |
|
Actually, something wonky is going on at the start of the new |
31d276f
to
e45c6db
|
Ok, it turned out to be this: cc41e04#diff-f5062b694b9fe53fc1757ed483d577d9R2788 Some squashing is expected, but otherwise should be ready to review now. |
|
Fresh gecko try push with all the new code: https://treeherder.mozilla.org/#/jobs?repo=try&revision=9be1f766b547f71074a3e41a9176c2c3584c5241 |
|
Reviewed 3 of 12 files at r1, 18 of 22 files at r2, 4 of 5 files at r3, 1 of 1 files at r4. Comments from Reviewable |
|
Looks good! Squash if you want and r=me. |
|
Also - before merging, it'd be good to have patches available for Servo and Gecko to deal with the API changes, to simplify the update process. |
|
Great stuff! |
| @@ -884,8 +886,9 @@ pub struct DynamicProperties { | |||
|
|
|||
| pub trait RenderNotifier: Send { | |||
| fn clone(&self) -> Box<RenderNotifier>; | |||
| fn new_frame_ready(&self); | |||
| fn new_scroll_frame_ready(&self, composite_needed: bool); | |||
| fn wakeup(&self); | |||
This comment has been minimized.
This comment has been minimized.
| fn new_frame_ready(&self); | ||
| fn new_scroll_frame_ready(&self, composite_needed: bool); | ||
| fn wakeup(&self); | ||
| fn new_document_ready(&self, DocumentId); |
This comment has been minimized.
This comment has been minimized.
nical
Nov 20, 2017
Collaborator
While you are modifying this interface, maybe it'd be a good time to merge new_document_ready and new_scroll_document_ready into a single one that has enough parameters (id, did_scroll, composite_needed) to avoid contortions like in #1963 when the scrolled and non-scrolled paths are merged.
This comment has been minimized.
This comment has been minimized.
|
Thanks for the reviews! Concerns are addressed now. |
|
|
|
@kvark Thanks for the update patches! Want to rebase this again and we'll get it merged before it bitrots again? :) |
Naming refactor of RenderedDocument DocumentLayer index for rendering order
Refactor FrameBuilder usage on the RenderBackend side to avoid None Simplified RenderedDocument Fix for building an empty frame Refactored RenderNotifier according to review comments Added an optimization to avoid clearing the whole screen if one of the documents does it
|
Rebased, added an optimization to avoid redundant clears (in a simple case of 1 document), and pushed another try push - https://treeherder.mozilla.org/#/jobs?repo=try&revision=376c737901e3a27405808e5a828126e60bd91cc5 |
|
@kvark Looks like there are some failures in that try push, but they seem the same (or similar) to ones we've had with recent PRs. I'm not sure if those are relevant or not in this case? |
|
@glennw those 10 are expected, same as with your #2052: https://treeherder.mozilla.org/#/jobs?repo=try&revision=e71afa7f78443212f702971f0a4eb05e27bf7b80 |
|
@bors-servo r+ |
|
|
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 -->
|
|
07ebcdf
into
servo:master
Flexible render target pool This is a follow-up to #2050, also a more generic solution in place of the fix in #2039. With multiple documents, we can't rely on stack-based render target re-use, since each document would expect a different stack and will force the wasteful re-allocation of render targets. With this PR, we'll first do a pass to re-use all perfectly matching targets for all documents. Then when each document is rendered, it will grab the remaining targets and re-initialize some parts of them, if needed. This scheme should guarantee efficient re-use of render target space for multiple documents, which are supposed to be used in Gecko for chrome, status bar, main page, and more. Note: target selection doesn't take the depth surface into account at the moment, so these may sometimes re-allocate inefficiently. This is something to keep an eye on and potentially follow-up. r? @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/2098) <!-- Reviewable:end -->
kvark commentedNov 16, 2017
•
edited
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:
(from #1943)box-shadow/boxshadow-skiprect.html(same as in #2053)css-filter-chains/moz-element.html(from #2043)transform/animate-layer-scale-inherit-1.htmlFrameBuilderandRenderedDocumentrefactorhttps://tools.taskcluster.net/groups/DEvThfCaQWmt5Hp806GDLg/tasks/VLCZI7hVTQCc1xrDR3PgOQ/details#
cc @glennw @mstange @jrmuizel
This change is