SkiaSharp/utils
Max Katz 9cbf9c80b7
Function pointers and LibraryImport (#2917)
* Update generator to emit function pointers

* Regenerate interop files

* Enable USE_LIBRARY_IMPORT in HarfBuzzSharp

* Enable USE_LIBRARY_IMPORT on SkiaSharp

* Set DisableRuntimeMarshalling on HarfBuzzSharp

* Replace remaining DllImports with LibraryImport on SkiaSharp

* Set DisableRuntimeMarshalling on SkiaSharp as well

* Fix missed proxy definition

* Regenerate skia api with a correct submodule version

* Collections literals are not supported on the CI .NET SDK

* An attempt to fix Tizen build

* Forgot about partial

* Set UnmanagedType.LPStr on evas_gl_proc_address_get instead

* Set USE_LIBRARY_IMPORT on remaining projects too

* Update generator tool to generate DelegateProxy as well

* Regenerate HarfBuzz and SkiaSharp with new DelegateProxy source gen

* Regenerate other projects as well

* Add `protected internal` to test classes too, since this project has InternalsVisibleTo configured

* Disable DelegateTypesAreValid and DelegateTypesHaveAttributes tests on .NET 7+ build, see comments

* Reduce warnings noise

* Update binding/SkiaSharp/GRGlInterface.cs

Co-authored-by: Filip Navara <filip.navara@gmail.com>

* Add missing USE_LIBRARY_IMPORT defines

* Update binding/SkiaSharp/GRGlInterface.cs

* Also needs USE_LIBRARY_IMPORT

---------

Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
Co-authored-by: Filip Navara <filip.navara@gmail.com>
2024-08-21 23:16:05 +08:00
..
NativeLibraryMiniTest Update .NET to 8.0 (#2927) 2024-07-26 00:28:28 +08:00
SkiaSharpGenerator Function pointers and LibraryImport (#2917) 2024-08-21 23:16:05 +08:00
WasmTestRunner Update .NET to 8.0 (#2927) 2024-07-26 00:28:28 +08:00
README.md Bind Skottie's Animation Builder (#2630) 2024-02-18 17:33:24 +02:00
Utils.sln Add & Run WASM Unit Tests (#1361) 2020-06-29 19:28:12 +02:00
generate.ps1 Validate the generated interop files (#2831) 2024-04-13 08:49:41 +02:00

README.md

Utils

This directory contains a few tools to help with the binding and development of SkiaSharp and related libraries.

SkiaSharpGenerator

This is a small set of tools that help with generating the p/invoke layer from the C header files.

Generate

This can be run with:

.\utils\generate.ps1
  • --config binding/libSkiaSharp.json
    The path to the JSON file that help generate a useful set of p/invoke definions and structures.
  • --skia externals/skia
    The path to the root of the skia source.
  • --output binding/Binding/SkiaApi.generated.cs
    The path to the generated file.

Verify

This can be run with:

dotnet run --project=utils/SkiaSharpGenerator/SkiaSharpGenerator.csproj -- verify --config binding/libSkiaSharp.json --skia externals/skia
  • --config binding/libSkiaSharp.json
    The path to the JSON file that help generate a useful set of p/invoke definions and structures.
  • --skia externals/skia
    The path to the root of the skia source.
  • --output binding/Binding/SkiaApi.generated.cs
    The path to the generated file.

This can be run with:

dotnet run --project=utils/SkiaSharpGenerator/SkiaSharpGenerator.csproj -- cookie --assembly binding\SkiaSharp\bin\Debug\netstandard2.0\SkiaSharp.dll --type "SkiaSharp.SkiaApi"

Or:

dotnet run --project=utils/SkiaSharpGenerator/SkiaSharpGenerator.csproj -- cookie --assembly binding\HarfBuzzSharp\bin\Debug\netstandard2.0\HarfBuzzSharp.dll --type "HarfBuzzSharp.HarfBuzzApi"
  • --assembly <assembly>
    Read the assembly and log any missing interops.
  • --type <full type name>
    The type containing the interops.

WasmTestRunner

Run the WASM unit tests in a browser.

This can be run with:

dotnet run --project=utils/WasmTestRunner/WasmTestRunner.csproj -- "http://localhost:5000/"
  • --output TestResults.xml
  • --timeout 30
  • --no-headless