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

272 Коммитов

Автор SHA1 Сообщение Дата
Matthew Leibowitz d0562fc3d7
Add a few more GPU debugging members (#1478) 2020-08-25 14:34:58 +02:00
Matthew Leibowitz 575652945d
Expose SKGraphics for Debugging (#1473)
* Expose the basic properties of SKGraphics
* Added SKTraceMemoryDump
2020-08-21 21:14:20 +02:00
Matthew Leibowitz bc2b0a2ace
Make sure to overwrite the underlying pixel (#1457)
Fixes #1434
2020-08-11 15:13:37 +02:00
Matthew Leibowitz 67e322ed97
Revert the code for SetScaleTranslate (#1452) 2020-08-09 21:46:45 +02:00
Matthew Leibowitz abfb84ca11
Fix the shaky unit test (#1441) 2020-08-01 17:23:36 +02:00
Matthew Leibowitz a8b6a24271
Handle invalid text correctly (#1438)
Fixes #1432
2020-07-31 13:57:22 +02:00
Matthew Leibowitz 48f5d343b3
Update skia to fix #465 (#1436) 2020-07-30 22:38:46 +02:00
Matthew Leibowitz a7bbd09c36
Fix issue when creating SKData from a non-seekable stream (#1411) 2020-07-16 04:40:53 +02:00
Matthew Leibowitz 9d17f42681
SKTypeface does not count bytes but glyphs (#1399)
Historically, SkTypeface.charsToGlyphs assumed the data was already in glyphs. So a UTF32 data array would pass the number of glyphs. Since that method was removed, we switched to SkFont.textToGlyphs. This worked in bytes. As a result, we need to make sure we convert from glyph count to byte count when we use it.
2020-07-14 02:16:50 +02:00
Matthew Leibowitz 90365158d5
Add snapshots with bounds (#1357) 2020-06-26 22:58:00 +02:00
Matthew Leibowitz 5e4c9e170c
Add an API to check the versions 2020-06-24 02:34:30 +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 a0af85182e
Terminate the paths 2020-06-20 20:59:27 +02:00
Matthew Leibowitz 89a9badaec
sadfasd 2020-06-20 19:43:15 +02:00
Matthew Leibowitz 98933ec019
Do both 2020-06-20 19:36:57 +02:00
Matthew Leibowitz d46678a5b1
sdfasdf 2020-06-20 19:31:31 +02:00
Matthew Leibowitz 2e785bd103
maybe this? 2020-06-20 19:25:52 +02:00
Matthew Leibowitz ce67da52e3
Maybe this will work... 2020-06-20 19:18:52 +02:00
Matthew Leibowitz 7b1399f5f8
DataCanBeCreatedFromManagedStream 2020-06-20 19:02:07 +02:00
Matthew Leibowitz ba9fe25e67
Try with data 2020-06-20 18:44:49 +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 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 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 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 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
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