Skip to content

perf(canvas): reduce interaction latency - #203

Draft
d8dzmf5mfn wants to merge 2 commits into
ZSeven-W:mainfrom
d8dzmf5mfn:codex/fix-canvas-interaction-latency
Draft

perf(canvas): reduce interaction latency#203
d8dzmf5mfn wants to merge 2 commits into
ZSeven-W:mainfrom
d8dzmf5mfn:codex/fix-canvas-interaction-latency

Conversation

@d8dzmf5mfn

Copy link
Copy Markdown

Summary

  • keep the live layout scene synchronized across consecutive resize, rotate, and shape-create frames
  • reuse a gesture-scoped drop index and avoid unconditional full-scene clones and repeated DFS during placement
  • use a lower-cost paint path while manipulating geometry, restoring full-quality rendering afterward

Root cause

Live gestures could mutate document geometry after the scene cache revision was captured, leaving the rendered scene one or more frames behind the document. Drag/drop also cloned and re-walked the full scene and rendered expensive effects on every pointer frame.

Impact

Canvas manipulation stays attached to the pointer, while manual shape placement avoids the previous main-thread stalls on larger documents.

Validation

  • cargo test -p op-host-native --features gl-host --lib — 667 passed
  • cargo clippy -p op-host-native --lib -- -D warnings -A clippy::unnecessary_min_or_max -A clippy::collapsible_match
  • cargo fmt --all -- --check
  • git diff --cached --check

Note

The repository-wide pre-commit Clippy gate currently stops on the pre-existing stop_count.max(0) warning in crates/op-editor-ui/src/widgets/property_panel_layout.rs:82, unchanged from upstream/main. The affected crate and complete interaction test suite pass as listed above.

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