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

Remove didCharSizeChange logic from renderer #1308

Merged
merged 1 commit into from
Mar 8, 2018

Conversation

bgw
Copy link
Member

@bgw bgw commented Mar 5, 2018

The only thing didCharSizeChange was used for was to figure out if we
need to refresh the character atlas or not. However, acquireCharAtlas
already inspects the atlas owned by this terminal, and if it matches, it
avoids generating a new atlas.

So if didCharSizeChange is true and it's not needed, it quickly bails
out as a no-op. But if didCharSizeChange is false, and it was needed
(possible given the complexity of testing all of these edge cases), it
could introduce a bug.

I think it makes sense to just get rid of didCharSizeChange, and just
always call acquireCharAtlas.

The only thing `didCharSizeChange` was used for was to figure out if we
need to refresh the character atlas or not. However, `acquireCharAtlas`
already inspects the atlas owned by this terminal, and if it matches, it
avoids generating a new atlas.

So if `didCharSizeChange` is true and it's not needed, it quickly bails
out as a no-op. But if `didCharSizeChange` is false, and it was needed
(possible given the complexity of testing all of these edge cases), it
could introduce a bug.

I think it makes sense to just get rid of `didCharSizeChange`, and just
always call `acquireCharAtlas`.
@Tyriar
Copy link
Member

Tyriar commented Mar 6, 2018

@bgw I think this looks good, changing settings and resizing rarely happens anyway, the main concern was extra GCs that could be caused by Renderer. onWindowResize but that's still blocked behind a check for window.devicePixelRatio. And yes, I think we have hit bugs of the char atlas not regenerating like you mention 😄

I'll merge this in once 3.2.0 gets branched off.

@Tyriar Tyriar self-assigned this Mar 6, 2018
@Tyriar Tyriar added this to the 3.3.0 milestone Mar 6, 2018
@Tyriar Tyriar merged commit b20fe80 into xtermjs:master Mar 8, 2018
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