Skip to content

Remove selection-specific render pass, use bg overrides instead#3783

Merged
Tyriar merged 2 commits intoxtermjs:masterfrom
Tyriar:bg_decorations__selection_refactor
May 11, 2022
Merged

Remove selection-specific render pass, use bg overrides instead#3783
Tyriar merged 2 commits intoxtermjs:masterfrom
Tyriar:bg_decorations__selection_refactor

Conversation

@Tyriar
Copy link
Copy Markdown
Member

@Tyriar Tyriar commented May 11, 2022

Builds on #3775
Part of #3778

This PR removes the additional render pass specific to selections along with the attribute buffer and supporting methods, instead using the bg override system added in #3775. Essentially replacing all that code with just:

    if (this._isCellSelected(x, y)) {
      bgOverride = this._colors.selectionOpaque.rgba >> 8 & 0xFFFFFF;
    }

And the _isCellSelected definition.

Consolidating selection rendering into the bg override system will allow controlling the rendering layers for #3778 such that decorations can be above or below the selection. It also applies minimum contrast ratio to the selection's background which I don't think was happening before.

Why didn't I do this to begin with? Resolving the inverse colors ahead of time wasn't worked through yet and there was the problem of how to handle the cache keys. Since we have that now this seems like the better approach from maintainability as well as for cpu/gpu/memory performance.

@Tyriar Tyriar added this to the 4.19.0 milestone May 11, 2022
@Tyriar Tyriar requested a review from meganrogge May 11, 2022 18:52
@Tyriar Tyriar self-assigned this May 11, 2022
@Tyriar Tyriar merged commit bc4158c into xtermjs:master May 11, 2022
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