Граф коммитов

255 Коммитов

Автор SHA1 Сообщение Дата
Matthew Leibowitz a3472b0627
Build for Linux ARM32 (armhf) and ARM64 (aarch64) (#1382)
Co-authored-by: jp2masa <jp2masa@users.noreply.github.com>
2020-07-07 02:23:42 +02:00
Matthew Leibowitz 35a7522bf8
Fix Packaging (#1366)
* Move non-netcoreapp native files into build
* Update samples
* Fix iOS GL interface assembler
2020-06-30 17:02:03 +02:00
Matthew Leibowitz 0526308c81
Re-generate the docs 2020-06-27 23:23:30 +02:00
Matthew Leibowitz 90365158d5
Add snapshots with bounds (#1357) 2020-06-26 22:58:00 +02:00
Matthew Leibowitz 2b6d2628fd
Reduce the usage of deprecated native functions (#1356) 2020-06-26 17:19:22 +02:00
Matthew Leibowitz 58348e14b4
Re-generate the API 2020-06-24 23:23:54 +02:00
Matthew Leibowitz 17d21be66b
Update native skia 2020-06-16 22:28:35 +02:00
Matthew Leibowitz 4d4d56156c
Fix a crash when there is no GL context (#1328)
* Add a test for #632
* Implement checks in native code
2020-06-10 23:19:37 +02:00
Matthew Leibowitz b7f02a67fe
Expose SKPath.ToWinding (#1326)
Fixes #840
2020-06-10 04:09:11 +02:00
Matthew Leibowitz 98cd9d2ecd
Expose SKPaint.ColorF (#1325)
Fixes #1239
2020-06-10 04:07:44 +02:00
Matthew Leibowitz 98bfa94da7
Improve the GPU APIs (#1294)
* Improve the Vulkan APIs
  - removed the context argument as this is unused as well as an older C/C++ feature
  - added a SharpVk version of the GetProc property.
* Removed the context argument (this is more an older C/C++ feature/requirement)
* Expose the WebGL APIs
* Improve the GRGlInterface and GPU delegates
  - removing the object context for the GPU construction
    - obsoleted GRGlGetProcDelegate in favour of the better named GRGlGetProcedureAddressDelegate
    - renamed GRVkGetProcDelegate to GRVkGetProcedureAddressDelegate
    - use "ProcedureAddress" instead of "Proc" to show that it is the "address" not the actual procedure
  - reworked the GRGlInterface
    - use the new non-context delegates
    - use better naming: Create*
    - adding WebGL
  - created a SharpVk-specific delegate GRSharpVkGetProcedureAddressDelegate
    - use actual types instead of IntPtr
* Reduce the using obsolete warnings
  - still a few left, mainly the colorspace and text blob
* Switch the way GRGlInterface.Create() works
  - first try OpenGL as that is actually what is expected
  - don't explode on an error, return null, like the rest
* Update API usages
2020-05-17 22:11:59 +02:00
Matthew Leibowitz e30ebdec35
Build for Vulkan on all supported platforms (#1287) 2020-05-16 03:14:31 +02:00
Matthew Leibowitz 6baf53f3ab
Vulkan Support for Win32 (and APIs for everyone as well) (#1010)
Add support for Vulkan on Win32 (#252)
* Bindings for m80 Vulkan backend context and related types. (#1276, #897)
* Added tests for Vulkan
* Rename the SKColorType enum values (#1222)

Co-authored-by: Davide Tuccilli <davide@gritworld.com>
Co-authored-by: Davide Tuccilli <d.tuccilli@gmail.com>
Co-authored-by: Dariusz Komosiński <darek.komosinski@gmail.com>
2020-05-14 03:01:38 +02:00
Matthew Leibowitz 295eea2a1b
Correct the p/invoke generation 2020-04-29 22:31:09 +02:00
Matthew Leibowitz 9ad68b65d4
Update to a much later version of skia (m80) (#986)
Several iterations of development to come to this:

* [UWP] Fix the ARM build and add ARM64
* [Win32] GDI is optional - and we don't want it
* Update harfbuzz to v2.6.2
* Use Docker
* Use a later version of the linux tools
* Use VS 2019
* Use Xcode 11
* Go all in with MSVC 14.2
* Disable the Tizen builds for now
* Add support for manually specifying VS (This can be done in a few ways, but the common way would be: --vsinstall='C:\PF\MVS\XXX\YYY')
* Update OpenJDK and Tizen Studio
* Using C++ 17
* Also added a THROW_ON_TEST_FAILURE env var to allow previews to be put out when tests are still failing
* Support basic text alignment
* Implement breakText in native code.
2020-04-28 22:20:20 +02:00
Matthew Leibowitz 290b61e17f
Expose a generic, writable span for the pixels (#1242)
* Expose a generic, writable span for the pixels
* Fixes #1240
* "Cache" the info object in size so we don' have to hop the interop.
* Raw pixels depend on the CPU endianness
2020-04-23 02:02:27 +02:00
Matthew Leibowitz 3d29c07bd7
Update expat native library to 2.2.9 (#1214) 2020-04-07 22:37:26 +02:00
Matthew Leibowitz aca03c2917
The lang parameter is not used, so remove it. (#1190)
Fixes #1189
2020-03-25 19:24:50 +02:00
Matthew Leibowitz 34b6018ad7
Update all the build tools (#1175)
- Windows builds to use the v14.2 compilers
- Android to use the r19c (min Android 19)
- OpenJDK 13.0.2
- Tizen Studio 3.6
- Build on VS 2019
- Added build args to support preview/any VS installs
2020-03-14 03:24:10 +02:00
Matthew Leibowitz ee0e668235
Use vcpkg to build ANGLE (#1158)
* Use vcpkg to build ANGLE
* Use a separate step to build ANGLE for now
* Use the new ANGLE constants
2020-03-03 00:09:52 +02:00
Matthew Leibowitz 842d6c7946
Update the docs and changelog 2020-02-27 17:52:54 +02:00
Matthew Leibowitz fc9f030a08
A few changes and improvements (#1153)
A few changes and improvements:
- add some helper members
- improved the SKBitmap.CopyTo and related members
- added Encode(...) to SKBitmap
- added Encode(...) with a .NET Stream to SKBitmap, SKImage and SKPixmap
- start the move from SKEncoding to SKTextEncoding
- added more tests
- generator now has a validator for ensuring all declarations have implementations
- added equality members to all structs

Bugs Fixed
- Bitmaps copied with SKBitmap.Copy sometimes have incorrect colors
- The GC would sometimes collect a stream that was being used by a PDF document
2020-02-27 15:12:00 +02:00
Matthew Leibowitz 5181109c45
Added more from SKImage (#1126) 2020-02-06 04:10:49 +02:00
Matthew Leibowitz 8f41230929
Added the rest of SKRegion members (#1125)
* Added the rest of SKRegion members. Fixes #1088
2020-02-05 15:59:15 +02:00
Matthew Leibowitz a358366921
Adding the SKColorF (with SKColorSpace) overloads (#1116)
* Adding SKColorF
* Improve the generator's sort
* Add SKColorF for SKPixmap
* Add the SKShader overloads and add some ToShader members
* Add some test for the SKColorF shaders
2020-02-01 20:58:44 +02:00
Matthew Leibowitz 5a62956fa4
Revert "Adding SKColorF #1115"
This reverts commit 150d210d93.
2020-01-28 14:36:41 +02:00
Matthew Leibowitz 150d210d93
Adding SKColorF #1115 2020-01-28 14:35:32 +02:00
Matthew Leibowitz e2514cda18
[WIP] Add GTK views for Xamarin.Forms (#1089)
* Adding GTK extension methods
* Add initial implementation for Xamarin.Forms GTK
* Better exceptions
* GTK v2 does not build on Windows CI
   This is because of mono not being installed. I could install it, but typically
   this is not available on normal dev boxes. So, to make things easier, just
   build on mac and linux.
2020-01-08 15:35:23 +02:00
Matthew Leibowitz 2f36be4761
Multi-target SkiaSharp.Views.Windows.Forms (#1082)
Related to #1029
2019-12-27 23:01:05 +02:00
Matthew Leibowitz 5e1f9a4132
Add SKShader binding to create Improved Perlin noise (#1056) 2019-12-23 14:30:25 +02:00
Matthew Leibowitz e84ba47396
Upgrade to VS2019 and .NET Core 3.0 (#1030)
* Upgraded a good few things
 - multitargeting for netstandard1.3, netstandard2.0, netcoreapp3.0 and net45
 - iOS, tvOS, macOS, watchOS now builds on non-macOS (not embedded binaries)
 - removed empty assembly infos
 - using Directory.Build.* to clean up a few things
 - improved the msbuild tasks to properly skip
* Add the targets file to the nuget
* Let all the tests run before failing the build
* Pack and validate in one go
* Update the samples to use the new projects
* Use VS 2017 for native builds for now
* Update Dockerfiles
* removed references from Views.WPF to OpenTK #1029 (#1078)
* Install the type redirector
* Update depot_tools
* Don't do any signing for macOS

Co-authored-by: Tyson Williams <34664007+bender2k14@users.noreply.github.com>
2019-12-22 18:50:47 +02:00
Matthew Leibowitz 6df2ae35e3
Cherry pick some fixes for buffer overflow bugs (#1037) 2019-11-27 10:14:24 +02:00
Matthew Leibowitz e0f57880ca
Bad header, generated C# 2019-11-22 03:25:06 +02:00
Matthew Leibowitz cc54784bdd
Add binding for SKTypeface.IsFixedPitch (#1019) 2019-11-19 21:36:53 +02:00
Matthew Leibowitz 2e2914f625
Final tweaks to prepare for release (#1013)
* PRs should use a custom prerelease label
* Update some docs
* Release the mouse when the button is released  
  We must not require that the Handled == true because in many
  cases it is not an action that is really handled. Especially if the
  mouse is captured - nobody else is receiving events.
2019-11-17 05:45:08 +02:00
Matthew Leibowitz 32690f42b4
Add some task to generate docs (#997)
* Add some task to generate docs
* Use the new native master
2019-11-05 23:04:27 +02:00
Matthew Leibowitz d16fd524b0
Created a P/Invoke Generator (#992)
* Added the new generator
* split some of the native builds into archs
* Update the native skia
* Generate the interop layer and use it
2019-11-05 19:38:03 +02:00
Matthew Leibowitz af74a6c5f8
Updating the submodules (#985)
* Updated FreeType for Linux
* Add fixes and tests for SkRegion.Contains return
2019-10-19 00:04:45 +02:00
Benedikt Stebner 9d3d4f577f HarfBuzzSharp 2.6.1 (#929)
* Add hb_ot_metrics
* Add int codepoint overloads
* It appears that the update of harfbuzz resulted in a 0.125 to the left
2019-09-28 16:18:59 +02:00
Matthew Leibowitz eaee17b73e
Enable bitcode for watchOS and tvOS (#971) 2019-09-28 04:43:10 +02:00
Matthew Leibowitz 08785f496a
Build arm64_32 architecture for watchOS (#967) 2019-09-27 06:00:44 +02:00
Matthew Leibowitz d5aa34a787
Re-work the managed-native types (#900)
Changes:
 - Added `GCHandleProxy` to debug builds
    - this is used to track all `GCHandle` `Alloc` and `Free` calls to ensure that all allocations are freed.
    - added some unit tests to make sure this is actually enforced
    - as a result, several object are now freed correctly
 - Added `ISKReferenceCounted` and `ISKNonVirtualReferenceCounted` interfaces to represent the reference counting types used in the native library
    - this helps with automatically de-referencing objects
 - `SKAbstractManagedStream`, `SKAbstractManagedWStream` and `SKDrawable` have been re-written to use better delegates
   - instead of passing each of the delegates as parameters, they are now a struct that is passed as a single object
   - better for extensions (which there shouldn't be) and only a single static field on the type
   - removed the usage of `Marshal.GetFunctionPointerForDelegate`, which should help out with WASM (see #876)
   - the objects now only keep weak references, meaning that they can now be garbage collected
   - instead of trying to resolve the instances with a dictionary, a delegate is used and passed as "user context"
 - Moved some of the repetitive logic from the types into the base `SKObject` and `SKNativeObject`
    - some logic is automatically executed if the concrete type is `ISKReferenceCounted` or `ISKNonVirtualReferenceCounted`
    - with the more centralized logic and stricter patterns, better tests can be written to make sure all memory is freed correctly and timely
 - `SKData`, `SKFontManager` and `SKTypeface` now correctly prevent disposal of the "static" instances
 - `SKPaint` now references the `Shader`, `MaskFilter`, `ColorFilter`, `ImageFilter`, `Typeface` and `PathEffect` properties
    - this prevents accidental collection, or non-collection when the object goes out of scope
 - the `SKPath` iterators (`Iterator` and `RawIterator`) and op builder (`OpBuilder`) now correctly own and dispose their native objects
 - `SKRegion` objects are now disposed on the native side
 - `SKTypeface` construction from a `SKManagedStream` (via both `SKTypeface` and `SKFontManager`) now copy the contents of the .NET `Stream` into a native memory
    - typeface construction requires multiple seeks (previously, the stream was copied only if it was non-seekable)
    - it also requires "duplicating" the stream, which is not supported on .NET streams
       - duplicates or forks of a stream means that each of the streams need to be read concurrently from different locations
       - .NET streams can only have a single position
 - Updated the NuGets used for the tests
     - using the `Xunit.AssemblyFixture` and `Xunit.SkippableFact` NuGets instead of using the code directly
    - removed the `Xunit.Categories` NuGet as it was preventing tests from running

This PR has a big set of changes that may be breaking due to bug fixes:
 - The `SKAbstractManagedStream`, `SKAbstractManagedWStream` and `SKDrawable` no longer prevent the GC from collecting them. This means that if code no longer references them, they will be disposed. 
    - As far as I can tell, this should not be a problem for the streams as they are never kept around - they are just used for reading and writing and typically only need to live for as long as a single method, and then need to be disposed by the caller. The `SKTypeface` and `SKDocument` do keep it around for a bit, but then they also take ownership of the stream and keep a hard reference to the streams themselves. They will dispose the streams when they are disposed.
    - `SKDrawable` is never kept around and is entirely a user-controlled object. If it goes out of scope, skia doesn't have a reference anyway.
 - The `SKFontManager` and `SKTypeface` no longer use the managed streams (`SKManagedStream` or `Stream`) directly 
- they make a copy.
    - This is simply because skia streams can do things that are not possible for .NET - they can be read concurrently from different positions. If a `SKFileStream` or `SKMemoryStream` are passed, then the streams are not copied.
    - Further optimizations can be made in the case of a `MemoryStream` or `byte[]` to not actually copy but use GC pinning to get a handle to the managed data and work with pointers. But this can be done later so that this PR can be merged and tested.
2019-07-30 03:26:21 +02:00
Benedikt Schroeder 1b0f3e371c Update HarfBuzz to v2.5.3 (#904)
- Update HarfBuzz to v2.5.3
 - Add UnicodeFunctions SetDelegate
 - Statically linked libstdc++ for Linux
2019-07-13 07:33:15 +02:00
Matthew Leibowitz 66e7ac6ebb
Use Span<T> for data, bitmap data and text blobs (#865)
* Add several overloads that take ReadOnlySpan<byte>
* Update to System.Memory 4.5.3
* Made a few tweaks to the text blob
 - copy using new Span<T> CopyTo method
 - split runbuffers out into their own file
* Add Span<T> overloads for the blob allocations
2019-06-26 12:56:14 +02:00
Benedikt Schroeder 5377b4bf36 Update HarfBuzz to v2.5.2 (#872)
Switched to clang for Android and Linux
2019-06-22 21:05:28 +02:00
Matthew Leibowitz d1723aae56
Update skia to fix a typo (#868) 2019-06-21 01:57:00 +02:00
Matthew Leibowitz 5da3cfd412
Support building SkiaSharp without fontconfig (#821) 2019-05-18 15:52:44 -07:00
Matthew Leibowitz 4d61b1df16
Merge branch 'master' into harfbuzzUpdate 2019-03-13 15:40:31 +02:00
Benedikt Schroeder ed15b84a6d Update HarfBuzz to 2.3.1 2019-02-25 18:14:34 +01:00
Matthew Leibowitz 8ebdc9a856
Merge branch 'master' into harfbuzzUpdate 2019-02-05 05:27:32 +02:00