Optimize Matrix.Elements (#47932)
authorJeremy Kuhne <jkuhne@microsoft.com>
Tue, 9 Feb 2021 15:56:14 +0000 (07:56 -0800)
committerGitHub <noreply@github.com>
Tue, 9 Feb 2021 15:56:14 +0000 (10:56 -0500)
commitd8aa4c6dd552c6e41ee5c24df1564bdc19ae2fde
tree3944ba1803b766090cd755b0513c5c3a0154a39a
parent171812ba7487283eaf6eff9d7c2bc97f96ef7c15
Optimize Matrix.Elements (#47932)

* Optimize Matrix.Elements

Just pin the array. There is no need to allocate native memory and copy.

* Move more element usage to the stack.

* Remove DeleteObject call
src/libraries/System.Drawing.Common/src/System/Drawing/Drawing2D/Matrix.cs
src/libraries/System.Drawing.Common/src/System/Drawing/GdiplusNative.cs
src/libraries/System.Drawing.Common/src/System/Drawing/Graphics.Windows.cs
src/libraries/System.Drawing.Common/src/System/Drawing/GraphicsContext.cs
src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Windows.cs
src/libraries/System.Drawing.Common/src/misc/GDI/WindowsGraphics.cs