dotnet / dotnet/winforms

Simplify GraphicsInternal optimization.

Open
#13,604 0 comments 1 reaction 1 assignee Claimed by @JeremyKuhne View on GitHub
area-System.Drawing
Dominant language
C#
Stars
4.9k
Forks
1.1k
Avg merge
20h 23m
Merged PRs (30d)
103

Description

This code was introduced to improve rendering performance to avoid figuring out what modifications were applied to the GDI+ GpGraphics. Now that we control System.Drawing we can add an internal optimization that tracks whether or not relevant state has been changed on the object.

This will allow greatly simplifying the code (we can remove all of the existing `GraphicsInternal` stuff) and improving performance across the board. We can access whatever flag we track on `Graphics` through `IGraphicsContextInfo` or `IGraphics`.

https://github.com/dotnet/winforms/blob/a64fee10485a618849e0bf5418ae2f76cc15ed66/src/System.Windows.Forms/System/Windows/Forms/Rendering/PaintEventArgs.cs#L127

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.