From 2186e9ee0679df1ed2b92b120c4d763277999bbc Mon Sep 17 00:00:00 2001 From: Andrii Kurdiumov Date: Sun, 16 Jan 2022 10:54:08 +0600 Subject: [PATCH] Explicit delegate types This is done to please AOT compilers. Removed not used MilGlyphCache_SetCreateGlyphBitmapsCallback Technically NativeAOT would handle that after https://github.com/dotnet/runtime/pull/63219/ but want to cleanup just in case overall I think using untyped delegates in C# is wrong --- .../Windows/Media/UnsafeNativeMethodsMilCoreApi.cs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/UnsafeNativeMethodsMilCoreApi.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/UnsafeNativeMethodsMilCoreApi.cs index 28a50c5becb..65d00c4e8fd 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/UnsafeNativeMethodsMilCoreApi.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/UnsafeNativeMethodsMilCoreApi.cs @@ -112,7 +112,7 @@ internal unsafe static extern int MilUtility_PathGeometryCombine( UInt32 nSize2, double rTolerance, bool fRelative, - Delegate addFigureCallback, + PathGeometry.AddFigureToListDelegate addFigureCallback, GeometryCombineMode combineMode, out FillRule resultFillRule); @@ -126,7 +126,7 @@ internal unsafe static extern int MilUtility_PathGeometryWiden( UInt32 nSize, double rTolerance, bool fRelative, - Delegate addFigureCallback, + PathGeometry.AddFigureToListDelegate addFigureCallback, out FillRule widenedFillRule); [DllImport(DllImport.MilCore)] @@ -137,7 +137,7 @@ internal unsafe static extern int MilUtility_PathGeometryOutline( UInt32 nSize, double rTolerance, bool fRelative, - Delegate addFigureCallback, + PathGeometry.AddFigureToListDelegate addFigureCallback, out FillRule outlinedFillRule); [DllImport(DllImport.MilCore)] @@ -148,14 +148,9 @@ internal unsafe static extern int MilUtility_PathGeometryFlatten( UInt32 nSize, double rTolerance, bool fRelative, - Delegate addFigureCallback, + PathGeometry.AddFigureToListDelegate addFigureCallback, out FillRule resultFillRule); - [DllImport(DllImport.MilCore)] - internal unsafe static extern int /* HRESULT */ MilGlyphCache_SetCreateGlyphBitmapsCallback( - MulticastDelegate del - ); - [DllImport(DllImport.MilCore)] internal unsafe static extern int MilGlyphCache_BeginCommandAtRenderTime( IntPtr pMilSlaveGlyphCacheTarget,