Closed Bug 1923846 Opened 1 year ago Closed 1 year ago

Support snapshotting individal pipelines off screen

Categories

(Core :: Graphics: WebRender, task, P3)

task
Points:
8

Tracking

()

RESOLVED FIXED
141 Branch
Tracking Status
firefox141 --- fixed

People

(Reporter: nical, Assigned: nical)

References

(Regressed 1 open bug)

Details

(Whiteboard: [viewtransitions:m2:gfx])

Attachments

(4 files)

No description provided.
Whiteboard: [viewtransitions:m1:gfx]
Whiteboard: [viewtransitions:m1:gfx] → [viewtransitions:m2:gfx]

The view-transition implementation needs a way to produce snapshots of various elements
before starting the transition without affecting the state of the current scene.
This commit makes this possible by adding the an "offscreen scene" concept to webrender.
Offscreen scenes are one-off scenes that are rendered immediately using a temporary frame
builder, temporary interners, etc. The only way that these offscreen scenes can have an
observable effect is by rendering snapshots into images of the resource cache which can
then be picked up by regular scenes.

To use the API:

  • Create a pipeline.
  • Build a display list for that pipeline containing snapshotted stacking contexts.
  • Invoke Transaction::render_offscreen(pipelind_id).
  • Delete the pipeline.

Long term it's worth revisiting whether this would be a good use case for the document API.
Some documents could be associated to a window while other documents remain off-screen.
Documents would have their own frame builder, interners and other retained states except for
the resource cache and gpu_caches that would be shared between all documents. Doing it this
way requires more work but would remove the need for a separate API and concept.

Assignee: nobody → nical.bugzilla
Status: NEW → ASSIGNED

This is quite the unsavory hack. For view-transition, the WR layer manager and bridge needs to be able to create a temporary pipeline without altering the one that is associated with the bridge and part of the scene that is being displayed. To do that the layer manager needs a pipeline Id to attach this premporary pipeline to, but allocating pipeline IDs is currently done in the main thread of the parent process and we can't afford the round-trip.
To work around this limitation, the patch makes it so that the pipeline IDs are effectively allocated in pairs. The even number is used for main pipeline ids, and the odd one can be used for temporary pipelines without risking collitions.

Ideally we would only allocate namespace ids (the upper 32 bits of the pipeline id) on the parent process main thread so that webrender bridges have the possibility to manage a large number of pipeline ids.

Points: --- → 8
Pushed by amarc@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/377e0e782805 https://hg.mozilla.org/integration/autoland/rev/f3ef179e4433 Revert "Bug 1923846: apply code formatting via Lando" for causing wr failures @ massive-element-below-and-on-top-of-viewport-partially-onscreen-old.html

Backed out for causing wr failures @ massive-element-below-and-on-top-of-viewport-partially-onscreen-old.html

Flags: needinfo?(nical.bugzilla)
Flags: needinfo?(nical.bugzilla)

Something odd is happening on android specifically (the nothing-captured.html timeout is the worrying one).
This patch set contains important architectural changes for view-transition that I rather not block on the android failures, but it deserves followup investigations.

Pushed by abutkovits@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/69c4317b5b65 https://hg.mozilla.org/integration/autoland/rev/eb61a491850c Revert "Bug 1923846: apply code formatting via Lando" for causing failures at massive-element-below-and-on-top-of-viewport-partially-onscreen-old.html.
Flags: needinfo?(nical.bugzilla)
Regressions: 1971324
Duplicate of this bug: 1959648
QA Whiteboard: [qa-triage-done-c142/b141]
Duplicate of this bug: 1964537
Regressions: 1982053
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: