Skip to content

frameclock: make backend adapters stateless - #47

Merged
waywardmonkeys merged 1 commit into
forest-rs:mainfrom
waywardmonkeys:frameclock/drop-retained-wrappers
Jul 2, 2026
Merged

frameclock: make backend adapters stateless#47
waywardmonkeys merged 1 commit into
forest-rs:mainfrom
waywardmonkeys:frameclock/drop-retained-wrappers

Conversation

@waywardmonkeys

@waywardmonkeys waywardmonkeys commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Remove the retained AppleFrameClock and WebFrameClock wrappers so backend crates no longer mirror FrameDriver lifecycle state. The backend APIs now expose tick-to-FrameOpportunity helpers, leaving request, begin, submit, and discard ownership with hosts and frameclock::FrameDriver.

Add the same frame_opportunity shape for Apple, Web, and Wayland and update the examples and READMEs to drive FrameDriver directly. Apple keeps platform facts as stateless helpers: DEFAULT_FEEDBACK_MODE maps the selected display-link source to FrameSubmission, and preferred_frame_rate_range_for_frame keeps ProMotion call sites compact.

This keeps platform crates responsible for display-link facts and presentation hints, while hosts stay responsible for retained frame lifecycle and native presentation resources.

Remove the retained `AppleFrameClock` and `WebFrameClock` wrappers so backend crates no longer mirror `FrameDriver` lifecycle state. The backend APIs now expose tick-to-`FrameOpportunity` helpers, leaving `request`, `begin`, `submit`, and `discard` ownership with hosts and `frameclock::FrameDriver`.

Add the same `frame_opportunity` shape for Apple, Web, and Wayland and update the examples and READMEs to drive `FrameDriver` directly. Apple keeps platform facts as stateless helpers: `DEFAULT_FEEDBACK_MODE` maps the selected display-link source to `FrameSubmission`, and `preferred_frame_rate_range_for_frame` keeps ProMotion call sites compact.

This keeps platform crates responsible for display-link facts and presentation hints, while hosts stay responsible for retained frame lifecycle and native presentation resources.
@waywardmonkeys
waywardmonkeys force-pushed the frameclock/drop-retained-wrappers branch from 8ad79de to 698ff6e Compare July 2, 2026 20:19
@waywardmonkeys waywardmonkeys changed the title frameclock: drop retained backend wrappers frameclock: make backend adapters stateless Jul 2, 2026
@waywardmonkeys
waywardmonkeys merged commit ec8b20e into forest-rs:main Jul 2, 2026
15 checks passed
@waywardmonkeys
waywardmonkeys deleted the frameclock/drop-retained-wrappers branch July 2, 2026 20:26
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.

1 participant