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 System.Drawing to remove DeviceContext #10293

Closed
elachlan opened this issue Nov 14, 2023 · 3 comments
Closed

Refactor System.Drawing to remove DeviceContext #10293

elachlan opened this issue Nov 14, 2023 · 3 comments
Assignees
Labels
area-Interop area-System.Drawing System.Drawing issues enhancement Product code improvement that does NOT require public API changes/additions tenet-performance Improve performance, flag performance regressions across core releases

Comments

@elachlan
Copy link
Contributor

Based on comment at #10291 (review)

The System.Drawing usage (of WeakRefCollection) can ultimately go away. It is only used to get call backs on the DeviceContext disposals. If someone is feeling up for a challenge they can kill the DeviceContext class in System.Drawing. I did the same for WinForms some time ago. #3553 was the last of that change.

Related: #9879

@elachlan elachlan added enhancement Product code improvement that does NOT require public API changes/additions tenet-performance Improve performance, flag performance regressions across core releases area-Interop area-System.Drawing System.Drawing issues labels Nov 14, 2023
@elachlan
Copy link
Contributor Author

@JeremyKuhne One thing I noticed is that the DeviceContextHdcScope is in System.Windows.Forms.Primatives and relies on some of the CsWin32 types. Would these get moved to System.Drawing.Common?

@JeremyKuhne
Copy link
Member

One thing I noticed is that the DeviceContextHdcScope is in System.Windows.Forms.Primatives and relies on some of the CsWin32 types.

Taking a dependency on CsWin32 should be explored. Note that WindowsGraphics is part of what goes away with this. Following the patterns in the #3553 should help in converting this stuff. All of this was in the same codebase in the past.

@elachlan
Copy link
Contributor Author

@JeremyKuhne now that #10645 is merged, can we resolve this issue?

@github-actions github-actions bot locked and limited conversation to collaborators Feb 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Interop area-System.Drawing System.Drawing issues enhancement Product code improvement that does NOT require public API changes/additions tenet-performance Improve performance, flag performance regressions across core releases
Projects
None yet
Development

No branches or pull requests

2 participants