S005: one painter per window (D-008); PiP in its own web view
All tabs of a window share one offscreen context and so one Servo painter. Picture in picture loads the page again in a web view with a painter of its own and seeks the video; the tab resumes from the PiP time on exit. The PiP video froze because Servo 0.7 stalls a playing video that is seeked and then play()ed; pip.start now pauses before seeking. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
parent
e75a48a0fa
commit
d6cdaa3411
1 changed files with 238 additions and 80 deletions
|
|
@ -50,16 +50,21 @@ src/ui/ egui: chrome (tab strip, toolbar, omnibox, bookmarks bar), me
|
|||
`BrowserWindow`s. Window kinds: Normal, App (site installed as app: no toolbar), Pip (always on top, one video).
|
||||
- Incognito is a second process (`nacre --incognito`) with a temporary profile that is deleted on exit, because
|
||||
Servo 0.7 has no per-WebView private mode.
|
||||
- Rendering: per window one `WindowRenderingContext` (surfman). Each tab gets its own
|
||||
`OffscreenRenderingContext` made from it, so Servo gives each tab its own painter (WebRender instance).
|
||||
egui (egui_glow on the window context's glow API) draws the chrome and a paint callback blits the tab's
|
||||
- Rendering (D-008): per window one `WindowRenderingContext` (surfman) and one `OffscreenRenderingContext`
|
||||
made from it (`BrowserWindow::page_context`), shared by all the window's tabs, so Servo makes one painter
|
||||
(WebRender instance) per window. Only the active tab's web view is shown; `painted_tab` records whose page is
|
||||
in the framebuffer, so a tab switch forces a repaint. While no tab shows a page (internal page, PiP
|
||||
placeholder) `paint_unshown` still paints, because Servo keeps reporting the frame until it is painted.
|
||||
egui (egui_glow on the window context's glow API) draws the chrome and a paint callback blits the page
|
||||
framebuffer into the page rectangle (`render_to_parent_callback`). glow is 0.17 on both sides.
|
||||
Why per tab and not per window like servoshell: Servo 0.7 always draws a painter's visible webviews at the
|
||||
origin at full size, so only separate painters allow picture-in-picture (the PiP tab's context is resized to
|
||||
the PiP window, read back with `read_to_image` and shown as a texture in the PiP window) and split view.
|
||||
Cost: a WebRender instance per tab. Kept in check by `thread_pool_webrender_workers_max = 2` and by unloading
|
||||
idle tabs (perf settings). If shared-GL painters misbehave at first build, fall back to one per window and
|
||||
drop split view; PiP then becomes "reopen the video in the PiP window at the same time".
|
||||
Why not one painter per tab: each painter is a full WebRender instance (~56 MB and ~6 threads; 15 tabs took
|
||||
1128 MB vs 341 MB shared, same frame time; S005). Servo 0.7 draws a painter's visible web views at the origin
|
||||
at full size, so one shared painter rules out split view.
|
||||
Picture in picture: `pip.take` pauses the tab's video and returns its time; a second web view (`Tab::pip`)
|
||||
with a context and painter of its own loads the same URL at the PiP window's size, `pip.start` seeks and
|
||||
plays it once loaded, and its frames are read back (`read_to_image`) into the PiP window. On exit `pip.state`
|
||||
hands the time back to the tab (`pip.resume`). The page is reloaded, so its state (logins aside) is lost.
|
||||
Servo 0.7 freezes a playing video that is seeked and then `play()`ed: pause before seeking.
|
||||
- Servo callbacks arrive on the main thread inside `servo.spin_event_loop()`. The delegate (`hub::Hub`) answers the
|
||||
synchronous ones right there (resource loads -> ad blocker, navigation requests -> HTTPS-only / downloads /
|
||||
external schemes) and queues the rest as `Event`s that `App` drains after each spin.
|
||||
|
|
@ -128,6 +133,8 @@ picture-in-picture, extensions, password capture, printing.
|
|||
|
||||
## Engine limits (shown as unavailable, not hidden)
|
||||
|
||||
- Picture in picture reloads the page in its own web view (one painter per window, D-008): page state is
|
||||
lost and the video restarts loading before it jumps to the same time.
|
||||
- Widevine / DRM video: Servo has no EME. The setting stays, marked "not available with this engine".
|
||||
- Chrome extensions: not possible. Replaced by user scripts and user styles (Apps -> Scripts).
|
||||
- Hardware acceleration switch: Servo needs GL; "Off" selects software GL (LIBGL_ALWAYS_SOFTWARE) on next start.
|
||||
|
|
|
|||
Loading…
Reference in a new issue