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

803 Коммитов

Автор SHA1 Сообщение Дата
Matthew Leibowitz 08da8bf8aa
Keep the font set alive (#1362) 2020-06-29 06:44:15 +02:00
Matthew Leibowitz a5d30e95a6
Build SkiaSharp for Win32 ARM64 (#1358)
* Build SkiaSharp for Win32 ARM64
* Drop net45 so we can use new and more performant things
2020-06-27 02:41:26 +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 b24eff58cc
Ensure that null is correctly handled 2020-06-25 03:43:25 +02:00
Matthew Leibowitz a4754b6284
Merge pull request #1332 from mono/dev/reduce-m44 2020-06-25 03:07:42 +02:00
Matthew Leibowitz 335d82b063
Should be private 2020-06-25 02:43:41 +02:00
Matthew Leibowitz ed86f4d317
Regen 2020-06-24 23:38:30 +02:00
Matthew Leibowitz 12888e0a31
Merge branch 'master' into dev/library-loading 2020-06-24 23:36:20 +02:00
Matthew Leibowitz 65c472b71a
Merge branch 'master' into dev/reduce-m44 2020-06-24 23:33:50 +02:00
Matthew Leibowitz 58348e14b4
Re-generate the API 2020-06-24 23:23:54 +02:00
Matthew Leibowitz 17a1fedc5d
Whoops 2020-06-24 19:22:42 +02:00
Matthew Leibowitz a26d11b7fa
Fix some ws 2020-06-24 02:34:37 +02:00
Matthew Leibowitz 5e4c9e170c
Add an API to check the versions 2020-06-24 02:34:30 +02:00
Matthew Leibowitz 4f69269a0a
harfbuzz is not ready yet 2020-06-22 23:55:24 +02:00
Matthew Leibowitz 2e957bbe37
Revert "add back"
This reverts commit dc6fdc7cf1.
2020-06-22 23:42:10 +02:00
Matthew Leibowitz dc6fdc7cf1
add back 2020-06-22 23:40:03 +02:00
Matthew Leibowitz fe56e84477
No more need for preferred 2020-06-22 23:31:44 +02:00
Matthew Leibowitz 453ac483c5
wrong item 2020-06-22 23:23:20 +02:00
Matthew Leibowitz c0eab0f32e
fix targets 2020-06-22 23:19:05 +02:00
Matthew Leibowitz 80b631d404
improve the copying 2020-06-22 22:42:29 +02:00
Matthew Leibowitz b4a190f269
Clean a few things 2020-06-22 12:30:03 +02:00
Matthew Leibowitz 573be04cbe
Fix the defines 2020-06-22 10:34:18 +02:00
Matthew Leibowitz 9db75c33b1
Merge remote-tracking branch 'origin/master' into dev/library-loading 2020-06-21 21:23:44 +02:00
Matthew Leibowitz 57c3b576c5
Correctly dispose (again) the managed/native object relationship (#1344) 2020-06-21 21:18:57 +02:00
Matthew Leibowitz 2ccf65f4cc
Use a better define 2020-06-20 22:37:18 +02:00
Matthew Leibowitz a0af85182e
Terminate the paths 2020-06-20 20:59:27 +02:00
Matthew Leibowitz d46678a5b1
sdfasdf 2020-06-20 19:31:31 +02:00
Matthew Leibowitz ce67da52e3
Maybe this will work... 2020-06-20 19:18:52 +02:00
Matthew Leibowitz 6da54b49c0
switch back to delegates 2020-06-20 03:47:17 +02:00
Matthew Leibowitz 97014aca11
trying everything now 2020-06-20 03:07:48 +02:00
Matthew Leibowitz 32811fc838
Do everything! 2020-06-20 00:36:14 +02:00
Matthew Leibowitz d4269f4fc2
Try DependsOnNETStandard 2020-06-20 00:01:13 +02:00
Matthew Leibowitz c126e6f666
Looks like we have to get a bit weird 2020-06-19 23:34:34 +02:00
Matthew Leibowitz 6f35ed94ac
Don't break the paths 2020-06-19 19:10:59 +02:00
Matthew Leibowitz 7cda786b8a
Load specific native libraries on desktop/netfx
This fixes 2 issues:
- loading multiple versions of libSkiaSharp (#1252)
- resolving the issue with 32/64 bit dll (#713)
2020-06-19 01:49:29 +02:00
Matthew Leibowitz c23eab0bf9
Add Alpine Native Libraries (#1339)
Building using Alpine 3.9. Tested on Alpine 3.7.
This is both the full libSkiaSharp and the "no dependencies" build.
2020-06-17 19:15:50 +02:00
Matthew Leibowitz 31df3fffa8
Fix the message 2020-06-11 22:03:50 +02:00
Matthew Leibowitz 2a2452a065
Reduce the usage of SKMatrix44 2020-06-11 21:58:31 +02:00
Matthew Leibowitz 69c89d555e
Don't embed libSkiaSharp in the assemblies (#1296)
* Don't embed libSkiaSharp in the dlls
* Update the samples to use the new .targets
* Update forms
2020-06-10 21:03:56 +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 5b08f569ac
Use the correct shaders (#1323)
Instead of adding a new overload that is already gone, add the new one that was added and is staying around for a bit.
2020-06-06 22:35:06 +02:00
Matthew Leibowitz 282638783f
Update Samples (#1313)
* Update samples (new things, AndroidX, updated versions)
* Update icons
* Move away from all obsolete uses
* Temporary workaround for https://developercommunity.visualstudio.com/content/problem/1057547/incorrect-file-validation-for-the-installappleprov.html
* Fix the API diff
2020-06-03 23:30:51 +02:00
Matthew Leibowitz daff651a41
Improved the structs a bit 2020-05-20 01:21:33 +02:00
Matthew Leibowitz 6b7e348f61
Make the SKFont's public API glyph-only and the others types use it under the hood (#1299)
- Make SKFont glyph-only
- hide the SKFont members that take strings/bytes
- hide the overloads that return arrays (promote the use of the "out span")
- expose string/byte members on SKPaint, and only expose the returning array (for consistency)
- use a single instance of SKFont for SKTypeface glyph members
- Add glyph-based MeasureText
2020-05-18 21:00:35 +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
Peter Verswyvelen 38f2220edb
Implemented SKCanvas.DrawTextOnPath (#1198)
Google deleted `DrawTextOnPath` so this PR adds it back along with other text-related APIs.
 - Added an overload for `SKCanvas.DrawTextOnPath` that disables glyph warping
 - Wrapped the `ArrayPool<T>.Shared` logic into a disposable util method
 - Renamed `SKFont.GetPath` to `SKFont.GetTextPath` so that it makes more sense
 - Added `SKFont.GetTextPathOnPath` to get the text path, but following another path instance (warps glyphs)
 - Removed/obsoleted the non-glyph overloads for `SKTextBlobBuilder.Add*Run`
 - Added a set of `SKTextBlob.Create` overloads that are used to make "string" runs
 - A few other small changes to make the API better
 - Fixes #1183
2020-05-15 00:16:53 +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 3fb8c0cdc5
Adding back the removed enum members (#1285) 2020-05-13 02:36:33 +02:00
Matthew Leibowitz 401cf0336f
Merge 'master' into 'develop' 2020-05-10 17:06:57 +02:00
Matthew Leibowitz 5ea66f2a4a
Performance Improvements (#1277)
* Correct company name
* Fix targets file
* Hide native files from project tree
* Add benchmark project
* Add a feature to skip the object registration
   - ISKSkipObjectRegistration
   - objects implementing this interface will not be registered in the global dictionary
   - major perf boos (2.84x) due to not having to look up in a dictionary
   - use direct constructor instead of object factory
* Throw an exception in "debug" builds
2020-05-10 16:56:12 +02:00
Matthew Leibowitz ff30a59f73
Merge remote-tracking branch 'origin/master' into develop 2020-04-30 12:44:44 +02:00
Matthew Leibowitz 295eea2a1b
Correct the p/invoke generation 2020-04-29 22:31:09 +02:00
Matthew Leibowitz 22fcbe7c57
Prevent the GC from collecting "this" and "pixels" (#1258)
* Prevent the GC from collection "this"
* GC.KeepAlive for cases where we only use pixels pointers
2020-04-29 03:51:45 +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 cf6d95cba1
Rename some methods to be more .NET (#1255) 2020-04-28 18:05:20 +02:00
Matthew Leibowitz 6a2d2ed80c
No need to allocate on disposal (#1257) 2020-04-28 17:41:00 +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 0195b18746
Fixed unit tests crashes and a WGL deadlock (#1228 for master) (#1237) 2020-04-22 12:52:59 +02:00
Matthew Leibowitz cef01f15e6
Remove the [Preserve] attribute (#1229)
Since #1209, we no longer use reflection and the linker can go ahead and start removing things.
2020-04-13 14:26:04 +02:00
Matthew Leibowitz 2191818177
Make sure to not dispose system fonts (#1224)
Fixes #1220
2020-04-11 19:48:05 +02:00
Matthew Leibowitz 028c7459e5
A few changes to the way ArrayPool is used 2020-04-11 14:56:37 +02:00
Benedikt Stebner 5e94a9dc8e
Remove reflection usage for SKObject creation (#1209) 2020-04-11 13:43:09 +02:00
Matthew Leibowitz 4559061eb7
Add a test for text align (#1207) 2020-04-05 12:33:07 +02:00
Matthew Leibowitz 14813f82e0
Resolve some concurrency issues (#1200)
* Rework the assembly fixtures
* Fix concurrency issue with handle registration
* Save several ms and useless allocations
* Make sure to correctly own objects
* Native objects may be disposed at any time
* Keep the bitmap alive when just using the pixmap
* Cache the "static" font styles
2020-04-03 13:25:20 +02:00
Matthew Leibowitz 234c93a775
Fixing issue #1187 (#1206)
* Passing null to SkPathMeasure results in AccessViolationException

Co-authored-by: Ziriax <bugfact@gmail.com>
2020-04-02 15:56:31 +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 73bfe55954
Re-work views to avoid incorrect disposal (#1180) 2020-03-24 18:09:38 +02:00
Peter Verswyvelen bc50ace4c6
Merge filter factory overloads now accept null arguments (#1185)
- since null refers to the source graphics being drawn, passing null must be allowed
 - added unit test
2020-03-21 21:25:46 +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 a38b665127
Change paint encoding instead of throwing #1151 (#1152)
When the paint encoding is anything but GlyphId, the underlying allocation fails. This results in not only strange behaviour, but also invalid data. The run buffer is given a size, but nothing was allocated. This does 2 things:
- if a buffer is null, override the size
- if the encoding is not glyph, then change it temporarily
2020-02-21 20:30:13 +02:00
Matthew Leibowitz 8419446bb2
Revert "Change paint encoding instead of throwing #1151"
This reverts commit 3f6722185a.
2020-02-21 13:08:52 +02:00
Matthew Leibowitz 3f6722185a
Change paint encoding instead of throwing #1151
When the paint encoding is anything but GlyphId, the underlying allocation fails. This results in not only strange behaviour, but also invalid data. The run buffer is given a size, but nothing was allocated. This does 2 things:
- if a buffer is null, override the size
- if the encoding is not glyph, then change it temporarily
2020-02-21 13:08:43 +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 c5fa9aa04e
More Improvements (#1123)
* Make more members readonly (the generator now makes the equality members readonly)
* split the SKMatrix file into SKMatrix44, SKRotationScaleMatrix, SK3dView
* split the SKColorSpace structs/classes into a separate file
* reworked/renamed all the poorly designed SKMatrix (and related) members to be actually useful
* Make sure the obsolete items are invisible
* Make sure everything implements IEquatable<T>
* Update docs and changelogs
* ISKGLViewController is public
2020-02-04 19:00:41 +02:00
Matthew Leibowitz 7a2965a672
Improve Generator & Structs (#1122)
* Generator
- getters readonly 
- implement IEquatable

* Improve a few parts of the managed API
- mark obsolete members as invisible to the editor
- make struct getters readonly
- implement struct equality/hashcodes
- SKColor calculations use the SKColorF implementations
- some whitespace fixes to conform to styles
- split SKPMColor out into a new file
2020-02-03 12:58:54 +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 48c9d72a56
Add a few more members for SKCanvas (#1090)
- DrawArc
- DrawAtlas
- DrawPatch
- DrawRoundRectDifference
- IsClipEmpty and IsClipRect
2020-01-08 16:46:04 +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 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 ae5c43ef3b
Correctly decode images (#1055)
When decoding from SKData, it is not immediate. Rather, the data is passed to
a lazy image that is decoded when the pixels are actually needed. Thus,
passing fixed the byte[] array will result in invalid images if the array
is moved in memory or changed later on. So, we create a copy.

The other cases where the codec was use to construct a bitmap first are also
wrong. SKBitmap constructs differently to SKImage, and since SKImage is just
going to create a copy anyway, just copy the encoded data once, and pass the
data to SKImage. This way, we are all in with SKImage, and we get the expected
results.
2019-12-10 19:42:48 +02:00
Matthew Leibowitz 34093ecb6e
Pulling in some changes from other places (#1054) 2019-12-07 23:09:32 +02:00
Matthew Leibowitz dc9b306e28
Improve native build process + add Nano Server (#1040)
* Add Nano Server to the list (Fixes #676)
* Make separate cake files for native builds
2019-12-04 03:12:12 +02:00
Dalton Spillman 6c016dd2a5 TryRemove instances WeakReferences (#1039) 2019-12-02 02:31:47 +02:00
Matthew Leibowitz 215b513cb9
Fix issues with harfbuzz strings (#1034)
* Add unit tests to detect #1031
* Correctly marshal C `char*` as C# `byte*`
2019-11-27 10:14:46 +02:00
Matthew Leibowitz e0f57880ca
Bad header, generated C# 2019-11-22 03:25:06 +02:00
Matthew Leibowitz 1d91a99364
Fix bad colors (#1023)
* Add some more colors tests
* Use uint instead of SKColor in the interop
2019-11-20 22:23:12 +02:00
Matthew Leibowitz cc54784bdd
Add binding for SKTypeface.IsFixedPitch (#1019) 2019-11-19 21:36:53 +02:00
Matthew Leibowitz e422e45f85
Env.Is64BitOperatingSystem isn't in dotnet build (#1020) 2019-11-19 17:06:26 +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 9da3dade94
Use Clang for Windows (m68) (#1007)
* Switch to Clang for Win32
* Make sure to first dispose the native instance  
  In some cases, the native instance has callbacks into the managed world. This can be seen with the documents, they have a flush callback which requires that the managed objects all still exist. This is a valid situation where some object owns other managed objects. It is invalid to have some child object reference the parent object as there is no way of informing the child that it has no parent.
2019-11-11 22:13:41 +02:00
Matthew Leibowitz 29d87a1a93
Fix #994 (#1000)
Not quite sure what happened in #995
2019-11-06 18:24:35 +02:00
Alexandr 5f35253fa9 Bind SkPictureShader (#973) 2019-11-06 15:25:00 +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 d529468fc2
Fix a memory leak in SKRoundRect (#995)
* Fix a memory leak in SKRoundRect
* Resolves #994
* Added more tests
2019-11-05 03:54:58 +02:00