Commit Graph
33 Commits
Author SHA1 Message Date
ZacharyZhang-NY 05a7a0d67f Present Servo BGRA hardware surfaces 2026-05-13 00:22:00 -04:00
ZacharyZhang-NY 0db1caad69 Route web surface scrolls to Servo hit point 2026-05-12 23:29:40 -04:00
ZacharyZhang-NY 6f279bf3e6 T17: pixel-content smoke tests — red/blue data URLs render their actual colour through Servo 2026-05-11 01:03:52 -04:00
ZacharyZhang-NY 6e2bd20a9b T10.6: drop RGBA payload from the wire when the hardware path publishes a surface 2026-05-10 23:52:12 -04:00
ZacharyZhang-NY 07b9c9da01 T10.3: publish IOSurfaceHandle once per surface, current_surface_id per frame 2026-05-10 23:17:05 -04:00
ZacharyZhang-NY bb0bd0032f T10.2: extract IOSurface mach port from the hardware surface on macOS 2026-05-10 23:01:34 -04:00
ZacharyZhang-NY 1e38ace997 Add manual live_perf_bench driver for software vs hardware comparison 2026-05-10 22:56:06 -04:00
ZacharyZhang-NY 048c5dfecd Vendor a headless hardware RenderingContext for Servo
The first concrete step toward the T10 IOSurface zero-copy path
(plan in docs/t10-iosurface-plan.md). Before this commit the sidecar
process could only use `SoftwareRenderingContext` — CPU rasterising
plus an 8 MB RGBA readback per 1080p frame is most of where scroll
latency comes from after the file pipe (a80d039), Vec clone
(e02c0fd), texture dedup (7f3b8b4), and hash swap (3f184ee) have
all landed.

The blocker is purely architectural: `servo-paint-api 0.1` exposes
`OffscreenRenderingContext` only as a child of
`WindowRenderingContext`, which requires a `DisplayHandle +
WindowHandle`. The sidecar has no window. The underlying
`SurfmanRenderingContext` glue *can* drive a hardware adapter
against a `SurfaceType::Generic` offscreen surface, but its
constructor is private. Until the upstream PR lands, this commit
vendors the minimal slice of that glue into `ely_servo_host`:

  * `HardwareOffscreenContext::new(size)` uses
    `Connection::new() → create_adapter()` (real GPU, not the
    software adapter) and a `SurfaceType::Generic` offscreen
    surface. On macOS the surfman CGL backend backs that surface
    with an `IOSurface` — exactly the thing the IOSurface bridge
    in subsequent commits will reach for.
  * Implements `servo::RenderingContext` so it slots into
    `ServoBuilder::rendering_context` wherever the existing
    `SoftwareRenderingContext` does, with no other Servo-side
    knowledge.
  * Scope deliberately narrow: only the methods Servo's headless
    readback actually calls. `create_texture` /
    `destroy_texture` / `connection` / `refresh_driver` fall
    through to the trait's `None` defaults. `read_to_image` inlines
    the upstream `Framebuffer::read_framebuffer_to_image` helper so
    we don't reach for a private helper that may change shape.
  * No `RawWindowHandle` and no `RefreshDriver` — both belong to
    paths the headless sidecar doesn't take.

The whole thing is feature-gated on `hardware-render`. Default
builds compile zero new lines; the additional surfman / gleam /
glow / euclid / image / log deps are all `optional = true`. Sidecar
binary still uses `SoftwareServoHost` until a follow-up commit
threads the new context in behind a CLI flag.

A smoke test at `tests/hardware_rendering_context.rs` constructs
the context. On a host with a real GPU it returns `Ok`; on a no-GPU
CI host it logs the surfman cause and reports `ok` rather than
failing the suite — the test is guarding the wiring, not the
hardware availability. On this Mac it constructs cleanly.

The `expect_used` / `unwrap_used` workspace lints are honoured —
fallible reads return `None` instead of panicking, no `.expect()` /
`.unwrap()` survives in the vendored body. The two `unsafe` blocks
(loading GL function pointers via surfman's `get_proc_address`) are
the same blocks upstream uses, with `#[expect(unsafe_code)]` to
override the workspace `unsafe_code = "deny"` lint locally.

cargo test --bin ely_app: 120 passed.
cargo test -p ely_servo_host --features servo-engine,hardware-render
  --test hardware_rendering_context: 1 passed (constructs cleanly).
Pre-existing `manages_real_servo_webview_lifecycle` failure on
servo.org is unrelated (reproduces on b8795bf without this change,
already documented in T7's commit history).
2026-05-10 20:50:59 -04:00
ZacharyZhang-NY 1faa7423c1 Add Servo page zoom support 2026-05-09 12:32:44 -04:00
ZacharyZhang-NY 8b9c4579c1 Add active profile local data export 2026-05-09 08:23:37 -04:00
ZacharyZhang-NY 928bb3cfb0 Log PRD site rendering evidence 2026-05-09 03:23:39 -04:00
ZacharyZhang-NY 89a8e05eeb Harden PRD live site rendering checks 2026-05-09 01:03:19 -04:00
ZacharyZhang-NY 4ed1666ece Scope Servo permissions by profile origin 2026-05-08 23:47:05 -04:00
ZacharyZhang-NY 8334fcbd6e Wire sidecar profile data isolation 2026-05-08 22:10:10 -04:00
ZacharyZhang-NY 527762fd36 Harden PRD live site smoke coverage 2026-05-08 21:13:34 -04:00
ZacharyZhang-NY a299815e51 Stabilize live site smoke output 2026-05-08 20:05:24 -04:00
ZacharyZhang-NY e80e52bc7e Harden PRD site smoke retries 2026-05-08 19:23:38 -04:00
ZacharyZhang-NY 59b90c60ae Ensure PRD sites render through app sidecar 2026-05-08 18:31:52 -04:00
ZacharyZhang-NY e8a33d53f5 Stabilize PRD site sidecar snapshots 2026-05-08 17:54:32 -04:00
ZacharyZhang-NY cb115b61fe Bridge Servo screenshot capture 2026-05-08 16:06:26 -04:00
ZacharyZhang-NY 74c1e9ad4b Add PRD reference site smoke coverage 2026-05-08 15:48:09 -04:00
ZacharyZhang-NY 660d9f54e2 Bridge Servo webview resize 2026-05-08 15:22:05 -04:00
ZacharyZhang-NY 0ea43e8b81 Bridge Servo mouse drag input 2026-05-08 15:15:38 -04:00
ZacharyZhang-NY 7a09967d19 Bridge Servo touch tap input 2026-05-08 15:00:06 -04:00
ZacharyZhang-NY 292824dc10 Bridge Servo keyboard text input 2026-05-08 14:36:48 -04:00
ZacharyZhang-NY b786073826 Bridge Servo click input 2026-05-08 14:23:12 -04:00
ZacharyZhang-NY 7178174e20 Add Servo scroll snapshots 2026-05-08 13:54:56 -04:00
ZacharyZhang-NY 8e12d6690b Render PRD sites in real viewport 2026-05-08 13:20:43 -04:00
ZacharyZhang-NY 2fb6b15e2d Render Servo sidecar frames in shell 2026-05-08 12:43:38 -04:00
ZacharyZhang-NY fcdc2de076 Add Servo sidecar snapshot command 2026-05-08 12:17:41 -04:00
ZacharyZhang-NY 5f0773a043 Add Servo site compatibility frame smoke 2026-05-08 12:08:57 -04:00
ZacharyZhang-NY f10a2349f6 Avoid headless Servo paint noise 2026-05-08 00:15:29 -04:00
ZacharyZhang-NY b787486f8e Add Servo engine host runtime 2026-05-07 18:47:37 -04:00