-
Notifications
You must be signed in to change notification settings - Fork 516
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CoreGraphics] Adjust CGPDFOperatorTable to not use a generic Action …
…delegate. (#11560) * CoreCLR doesn't support generic Action delegates in reverse (P/Invokes), so we need to find a different solution. * The native CGPDFOperatorTable callback API is not very friendly to us, because we can't pass it callback-specific data, which means that the managed caller must conform to the FullAOT requirement of the managed callback (must be a static function; must have a MonoPInvokeCallback attribute). * We can leverage the new function pointer syntax in C# 9 to make these requirements enforced by the C# compiler (unmanaged function pointer + UnmanagedCallersOnly attribute). The resulting API is still clunky to use, but I don't see any way around that. Fixes this monotouch-test failure with CoreCLR: [FAIL] Tamarin : System.Runtime.InteropServices.MarshalDirectiveException : Cannot marshal 'parameter #3': Non-blittable generic types cannot be marshaled. at CoreGraphics.CGPDFOperatorTable.CGPDFOperatorTableSetCallback(IntPtr table, String name, Action`2 callback) at CoreGraphics.CGPDFOperatorTable.SetCallback(String name, Action`2 callback) at MonoTouchFixtures.CoreGraphics.PDFScannerTest.Tamarin() in xamarin-macios/tests/monotouch-test/CoreGraphics/PDFScannerTest.cs:line 102 Ref: dotnet/runtime#32963
- Loading branch information
1 parent
ab14e07
commit e8f2672
Showing
2 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e8f2672
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ [CI Build] Tests failed on Build ❌
Tests failed on Build.
API diff
✅ API Diff from stable
View API diff
API & Generator diff
✅ API Diff (from PR only) (no change)
✅ Generator Diff (no change)
Packages generated
View packages
Test results
1 tests failed, 192 tests passed.
Failed tests
Pipeline on Agent XAMBOT-1038.BigSur'
[CoreGraphics] Adjust CGPDFOperatorTable to not use a generic Action delegate. (#11560)
e8f2672
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.
Pipeline on Agent
[CoreGraphics] Adjust CGPDFOperatorTable to not use a generic Action delegate. (#11560)
e8f2672
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.
Pipeline on Agent
[CoreGraphics] Adjust CGPDFOperatorTable to not use a generic Action delegate. (#11560)
e8f2672
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Tests failed on macOS Mac Mojave (10.14) ❌
Tests failed on Mac Mojave (10.14).
Failed tests are:
Pipeline on Agent
[CoreGraphics] Adjust CGPDFOperatorTable to not use a generic Action delegate. (#11560)
e8f2672
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Tests failed on macOS Mac High Sierra (10.13) ❌
Tests failed on Mac High Sierra (10.13).
Failed tests are:
Pipeline on Agent
[CoreGraphics] Adjust CGPDFOperatorTable to not use a generic Action delegate. (#11560)
e8f2672
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.
Pipeline on Agent
[CoreGraphics] Adjust CGPDFOperatorTable to not use a generic Action delegate. (#11560)