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

Exposed isContextLost from animation loop #1453

Merged
merged 1 commit into from
Feb 16, 2021
Merged

Conversation

igorDykhta
Copy link
Collaborator

For visgl/deck.gl#5399

Background

Required to add better context lost state handling.

Change List

  • added isContextLost to AnimationLoop which returns the current state of the used WebGL context
  • AnimationLoop.redraw function exits early in case of a lost context

@igorDykhta igorDykhta changed the title exposed isContextLost from animation loop Exposed isContextLost from animation loop Feb 16, 2021
Copy link
Collaborator

@ibgreen ibgreen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want an onContextLost callback on the animation loop?

Note: There is a WebGL extension to simulate context lost for testing purposes.

https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_lose_context

It is supported on Chrome https://webglreport.com/

@igorDykhta
Copy link
Collaborator Author

Do we want an onContextLost callback on the animation loop?

Xiaoji proposed to move this check to anim-loop.

Note: There is a WebGL extension to simulate context lost for testing purposes.
https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_lose_context
It is supported on Chrome https://webglreport.com/

Yes, I'm using it to simulate a context lost event, and test luma > deck > kepler

@igorDykhta
Copy link
Collaborator Author

@ibgreen @Pessimistress Any idea why coverage has decreased here? Do we have invalid context during tests?

@Pessimistress
Copy link
Collaborator

Do we want an onContextLost callback on the animation loop?

Added by #1441

Any idea why coverage has decreased here? Do we have invalid context during tests?

Test coverage fluctuates sometimes. It's not necessarily caused by your change.

@igorDykhta igorDykhta merged commit 8731d4c into master Feb 16, 2021
@igorDykhta igorDykhta deleted the igr/expose-context-lost branch February 16, 2021 14:22
@ibgreen
Copy link
Collaborator

ibgreen commented Feb 16, 2021

Do we want an onContextLost callback on the animation loop?

Added by #1441

I was referring to adding it to AnimationLoop

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