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

Implement rectangle renderer and gpu rulers view part #228632

Merged
merged 15 commits into from
Sep 17, 2024
Merged

Implement rectangle renderer and gpu rulers view part #228632

merged 15 commits into from
Sep 17, 2024

Conversation

Tyriar
Copy link
Member

@Tyriar Tyriar commented Sep 14, 2024

Fixes #221211

Also respects scroll left for character rendering.

  "editor.rulers": [
    { "column": 80, "color": "#ff7777" },
    { "column": 81, "color": "#77ff77" },
    { "column": 82, "color": "#7777ff" },
    100,
    120
  ],

image

@Tyriar Tyriar added this to the September 2024 milestone Sep 14, 2024
@Tyriar Tyriar self-assigned this Sep 14, 2024
}

register(x: number, y: number, width: number, height: number, red: number, green: number, blue: number, alpha: number): IObjectCollectionBufferEntry<RectangleRendererEntrySpec> {
// TODO: Expand buffer if needed
Copy link
Member Author

Choose a reason for hiding this comment

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

// --- end event handlers

private _update() {
// TODO: Only write dirty range
Copy link
Member Author

Choose a reason for hiding this comment

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

@Tyriar Tyriar marked this pull request as ready for review September 17, 2024 14:00
@Tyriar Tyriar changed the title Rectangles initial Implement rectangle renderer and gpu rulers view part Sep 17, 2024
@Tyriar Tyriar merged commit 516ec31 into main Sep 17, 2024
7 checks passed
@Tyriar Tyriar deleted the tyriar/221211 branch September 17, 2024 14:54
Comment on lines +218 to +220
const rulers = this._viewGpuContext
? new RulersGpu(this._context, this._viewGpuContext)
: new Rulers(this._context);
Copy link
Member Author

Choose a reason for hiding this comment

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

@hediet FYI this is how the other ruler's implementation is being added, similar to ViewLinesGpu but the DOM one isn't being instantiated at all.

Comment on lines +52 to +54
const options = this._context.configuration.options;
const rulers = options.get(EditorOption.rulers);
const typicalHalfwidthCharacterWidth = options.get(EditorOption.fontInfo).typicalHalfwidthCharacterWidth;
Copy link
Member Author

Choose a reason for hiding this comment

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

At least for rulers, there isn't much opportunity to share code with the DOM implementation.

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 rulers with the webpgu renderer
2 participants