Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offscreen views #501

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Offscreen views #501

wants to merge 5 commits into from

Conversation

floryst
Copy link
Collaborator

@floryst floryst commented Nov 10, 2023

Views are rendered offscreen and kept persistent across layout changes. This should speed up layout changes and hopefully reduce potential webgl context losses from (theoretical) rapid unmount/mount of the rendering container.

Instead of having interaction and rendering occur on a single canvas, rendering is now performed on a dedicated offscreen canvas. Pixels are copied over from the rendering canvas to the interaction canvas, and interaction events are handled appropriately.

@aylward please test this out to see if it helps with context loss issues.

Separating the interaction container and the rendering container
currently results in one resizeobserver (on the interaction el) to
trigger a resize on the rendering el, but then that in turn triggers
rendering el resize listeners (nested resizeobserver).

setTimeout in resize() is a workaround.
Copy link

netlify bot commented Nov 10, 2023

Deploy Preview for volview-dev ready!

Name Link
🔨 Latest commit 8831e01
🔍 Latest deploy log https://app.netlify.com/sites/volview-dev/deploys/654eaf93f7ac170008e36fd2
😎 Deploy Preview https://deploy-preview-501--volview-dev.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@aylward
Copy link
Contributor

aylward commented Nov 11, 2023

Still happens - but maybe less often...

image

@sedghi
Copy link

sedghi commented May 7, 2024

The canvas loss can stem from various root issues. Here's what we found on the OHIF side:

OHIF/Viewers#3207

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.

3 participants