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

refactor: disable dirty rectangle rendering #6727

Merged
merged 1 commit into from
Jan 23, 2025
Merged

Conversation

Aarebecca
Copy link
Contributor

@Aarebecca Aarebecca commented Jan 14, 2025

  • G Canvas 渲染器关闭脏矩形渲染优化

Copy link

Walkthrough

This pull request refactors the G Canvas renderer by disabling the dirty rectangle rendering capability. This change affects how the canvas is rendered, potentially impacting performance and rendering behavior.

Changes

File Summary
packages/g6/src/runtime/canvas.ts Added a condition to disable dirty rectangle rendering for instances of CanvasRenderer.

@@ -360,6 +360,10 @@ function createRenderers(renderer: CanvasConfig['renderer'], layersName: CanvasL
layersName.map((layer) => {
const instance = renderer?.(layer) || new CanvasRenderer();

if (instance instanceof CanvasRenderer) {
instance.setConfig({ enableDirtyRectangleRendering: false });

Choose a reason for hiding this comment

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

Disabling dirty rectangle rendering may impact performance, especially in scenarios with frequent updates or large canvases. Ensure this change is intended and tested for performance implications.

@Aarebecca Aarebecca merged commit ba4f1e1 into v5 Jan 23, 2025
2 checks passed
@Aarebecca Aarebecca deleted the refactor/dirty-rendering branch January 23, 2025 03:40
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