SkiaCompat.SKPath.cs 752 B

1234567891011121314151617181920212223242526272829303132
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. using SkiaSharp;
  4. namespace Avalonia.Skia;
  5. internal static partial class SkiaCompat
  6. {
  7. public static void Transform(SKPath path, in SKMatrix matrix)
  8. {
  9. if (s_isSkiaSharp3)
  10. {
  11. #if NET8_0_OR_GREATER
  12. NewPathTransform(path, matrix);
  13. #else
  14. throw UnsupportedException();
  15. #endif
  16. }
  17. else
  18. {
  19. LegacyCall(path, matrix);
  20. static void LegacyCall(SKPath path, in SKMatrix matrix) =>
  21. path.Transform(matrix);
  22. }
  23. }
  24. #if NET8_0_OR_GREATER
  25. [UnsafeAccessor(UnsafeAccessorKind.Method, Name = "Transform")]
  26. private static extern void NewPathTransform(SKPath path, in SKMatrix matrix);
  27. #endif
  28. }