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

Expose API to clear texture atlas #3075

Merged
merged 1 commit into from
Sep 6, 2020
Merged

Conversation

Tyriar
Copy link
Member

@Tyriar Tyriar commented Sep 6, 2020

Using canvases on Electron (and plain Chromium I believe), when resuming
from sleep the graphics card may release the texture which results in
the terminal display and char atlas being corrupt. This API allows the
consumer to clear the texture atlas right after resuming, atlas warm up
is not done to simplify this process because the fact that atlases are
shared between multiple terminals complicates this.

Related microsoft/vscode#69665

Using canvases on Electron (and plain Chromium I believe), when resuming
from sleep the graphics card may release the texture which results in
the terminal display and char atlas being corrupt. This API allows the
consumer to clear the texture atlas right after resuming, atlas warm up
is not done to simplify this process because the fact that atlases are
shared between multiple terminals complicates this.

Related microsoft/vscode#69665
@Tyriar Tyriar added this to the 4.9.0 milestone Sep 6, 2020
@Tyriar Tyriar self-assigned this Sep 6, 2020
}
this._cacheCtx.clearRect(0, 0, TEXTURE_WIDTH, TEXTURE_HEIGHT);
this._cacheMap = {};
this._cacheMapCombined = {};
Copy link
Member Author

Choose a reason for hiding this comment

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

This PR also clears the combined cache map on texture clear which wasn't happening before, probably resulting in weird graphical artifacts.

@Tyriar Tyriar merged commit 47c486e into xtermjs:master Sep 6, 2020
@Tyriar Tyriar deleted the clearTextureAtlas branch September 6, 2020 22:18
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