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

Editor GPU: Support inline decorations that change only text color (eg. bracket pair colorization) #234127

Merged
merged 23 commits into from
Nov 22, 2024

Conversation

Tyriar
Copy link
Member

@Tyriar Tyriar commented Nov 18, 2024

This change adds support for rendering some inline decorations on the GPU, specifically those that only change the color style. This is done for each inline decoration by walking the stylesheet tree to find relevant styles, parsing them and applying the result to the glyph metadata.

See no yellow bar on the left, meaning they're all GPU lines:

image

Supporting all of CSS is obviously out of scope, but I think we could support the vast majority of decorations by supporting a small selection of styles like color, background-color, background, font-style, text-decoration-*, etc. most of which are easy to actually render once we get the data to the rasterizer.

Part of #227095
Fixes #233989

TODO follow ups deferred:

@Tyriar Tyriar added this to the November 2024 milestone Nov 18, 2024
@Tyriar Tyriar self-assigned this Nov 18, 2024
Since this now depends on the DOM, it's too difficult and inconsistent to
pass in a DOM node to do the inline decoration test on. It's simplest to
pass it in to whatever view parts need it.
@Tyriar Tyriar changed the title Decorations wip Editor GPU: Support inline decorations that change only text color (eg. bracket pair colorization) Nov 22, 2024
@Tyriar Tyriar marked this pull request as ready for review November 22, 2024 15:48
@Tyriar Tyriar merged commit 6070da4 into main Nov 22, 2024
8 checks passed
@Tyriar Tyriar deleted the tyriar/gpu_decorations_wip branch November 22, 2024 16:38
@Mrzosef

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Editor GPU: Render bracket pair colorization decorations on GPU
3 participants