Skip to content

Experimental: add opt-in 120 Hz rendering for Skiko Web - #1370

Draft
Konstantin (terrakok) wants to merge 4 commits into
masterfrom
air/120hz-display-support-implementation-for-skiko-8a625d50-5
Draft

Konstantin (terrakok) wants to merge 4 commits into
masterfrom
air/120hz-display-support-implementation-for-skiko-8a625d50-5

Conversation

@terrakok

Copy link
Copy Markdown
Member

iOS Safari can cap Skiko's rAF-driven canvas renderer at 60 Hz on ProMotion displays. This adds an experimental, disabled-by-default SkiaLayer.experimentalHighRefreshRateEnabled flag for Kotlin/JS and Kotlin/Wasm.

The experiment renders into a transferred OffscreenCanvas on the main thread, with timer/MessageChannel pacing aligned to rAF and a shared compositor animation/scroller while frames are requested. It falls back to ordinary rAF when transfer or OffscreenCanvas WebGL2 is unavailable. Includes a comparison sample and a WEB_HIGH_REFRESH_RATE.md usage guide, based on Rida F'kih's Safari experiment.

Experimental limitations: physical 120 FPS presentation on iOS/ProMotion has not been validated. Chromium callback counts do not establish presentation rate, and the WebKit behavior may change. Transfer is irreversible; hosts must resize through SkiaLayer.resize() and adapt any separate 60 Hz animation clock. This does not add high-frequency gesture controllers. Keeping this PR in draft pending device validation.

Validation:

  • JS and Wasm browser sample builds.
  • 7 SkiaLayer browser tests per backend, including fallback and OffscreenCanvas resize/reattach.
  • 6 scheduler browser tests per backend, covering phase alignment, rounded clocks, coalescing and lifecycle cleanup.
  • Chromium/SwiftShader sample checks: moving pixels, resize, idle/visibility pause-resume, display boost cleanup and ordinary rendering.

This branch has not been deployed

No deployments
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