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

Explicitly exit retired renderers. #1007

Merged
merged 5 commits into from
Jul 10, 2019
Merged

Explicitly exit retired renderers. #1007

merged 5 commits into from
Jul 10, 2019

Conversation

manthey
Copy link
Contributor

@manthey manthey commented Jun 26, 2019

Before, this was waiting for GC to clean up unused renderers, which might not happen if renderers were created and destroyed without a major GC event. If GC didn't occur, the webgl context wouldn't be released. This explicitly exits the renderers (and explicitly loses the webgl context) as soon as the renderer is no longer in use (due to autosharing).

@manthey manthey changed the title Explicitly exit of retired renderers. Explicitly exit retired renderers. Jun 26, 2019
Before, this was waiting for GC to clean up unused renderers, which
might not happen if renderers were created and destroyed without a major
GC event.  If GC didn't occur, the webgl context wouldn't be released.
This explicitly exits the renderers (and explicitly loses the webgl
context) as soon as the renderer is no longer in use (due to
autosharing).
@manthey manthey force-pushed the explicitly-lose-context branch from 0d5174a to b433cfb Compare June 26, 2019 13:29
manthey added 2 commits July 5, 2019 13:57
Previously, this was done on z-index changes.  Since layers can be
rendered in shared canvases, this is needed on layer removal or addition
since that can effect the overall computed tile layer offsets.
The default (`true` setting) will only autoshare if it is likely to not
result in a visual difference (layer opacity 0 or 1, tile layers below
non-tile layers).  The `"more"` setting will perform as before this PR
-- autosharing if the opacities are identical and irrespective of the
mixing of tile and non-tile layers.  `false`, as before, won't
autoshare.

This also adds a map level setting of `autoshareRenderer` which sets the
defaults for newly created levels.
Copy link

@matthewma7 matthewma7 left a comment

Choose a reason for hiding this comment

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

I gave this a try. The out of WebGL context issue is gone. 👍

manthey added 2 commits July 10, 2019 14:10
Add a third state for autoshareRenderer.
@manthey manthey force-pushed the explicitly-lose-context branch from c061d6a to 72fd125 Compare July 10, 2019 18:13
@manthey manthey merged commit e0cdc5f into master Jul 10, 2019
@manthey manthey deleted the explicitly-lose-context branch July 10, 2019 19:02
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.

2 participants