Skip to content

Version 1.68.1

Compare
Choose a tag to compare
@mattleibow mattleibow released this 22 Nov 05:34
e0f5788

SkiaSharp

A cross-platform 2D graphics API for .NET platforms based on Google's Skia Graphics Library. It provides a comprehensive 2D API that can be used across mobile, server and desktop models to render images.

Major Changes

This version adds several new members and types, but the core focus was on resolving some larger memory-related issues. This release hopes to fix several cases where incorrect memory usage resulted in a crash or undefined behavior.

  • Improved the performance and reliability of managed-native interop for delegates (removed an intermediate dictionary)
  • Fixed several issues with static instances of native objects being accidentally destroyed
  • Fixed several invalid memory operations in the managed-native interop
  • Improved the performance vastly by switching to using Clang on Win32

Changes

  • Added a new NuGet package for Linux that does not require libfontconfig (or any dependencies): SkiaSharp.NativeAssets.Linux.NoDependencies
  • Improved the performance of the wrapped managed streams (removed an intermediate dictionary)
  • Added overloads and members that accept and return Span<T> in addition to the existing byte[] or IntPtr
  • Added bindings for SKDrawable and related operations [@charlenni]
  • Added several APIs to enhance the features of colorspaces (SKColorSpace and related types and members)
  • Fixed an issue where the underlying stream of an open SKDocument would be destroyed before the document is closed
  • Fixed an issue where typefaces did not release managed streams
  • Added more members to SKRegion [@vexx32x]
  • Added more members to SKPaint and SKMatrix [@MarchingCube]
  • Additional APIs in a few places
  • Added bindings for SKRunBuffer, SKHorizontalRunBuffer and SKPositionedRunBuffer to greatly enhance the usefulness of SKTextBlob and SKTextBlobBuilder
  • Added bindings for creating a SKShader from a SKPicture [@alexandrvslv]
  • Resolved an issue where the incorrect version of the native library was copied into the output of a Full Framework Xamarin.Mac app
  • Fixed a bug with Android emulators and incorrect colors [@inforithmics]
  • Improved stability of SKSwapChainPanel on UWP

Maintainence

  • Docs moved to a new repository SkiaSharp-API-docs
  • Improving the build scripts [@danien]
  • The p/invoke layer is now generated along with most of the structs and enums
  • Using more modern code conventions to reduce complexity and boilerplate
  • Added more tests for corner cases
  • Other docs changes [@HankiDesign]

Links

NuGet | Code Diff | Project | Milestone | Changelog | CI | Release CI

SkiaSharp.Views

A set of pre-prepared UI views, panels and surfaces for drawing. One of these views can be added to the view hierarchy, and then be used for drawing without the need for complex setup. There is also a set of extension methods for converting to/from SkiaSharp and native types.

Changes

  • Split the SkiaSharp.Views package into separate ones for WPF, Windows Forms, GTK# 3 so that they can be used with .NET Core 3.0:
    • SkiaSharp.Views.Gtk2 for GTK# 2
    • SkiaSharp.Views.Gtk3 for GTK# 3
    • SkiaSharp.Views.WPF for WPF (both .NET Framework and .NET Core)
    • SkiaSharp.Views.WindowsForms for System.Windows.Forms (both .NET Framework and .NET Core)
    • SkiaSharp.Views.Desktop.Common (base package for SkiaSharp.Views.WPF and SkiaSharp.Views.WindowsForms)
  • Added initial support for GTK# 3 with SKDrawingArea
  • Fixed an issue with convertion from a System.Drawing.Bitmap to SKPixmap [@Odirb]

Links

NuGet | Changelog

SkiaSharp.Views.Forms

A set of pre-prepared views for Xamarin.Forms, for fully cross-platform drawing code. There are views for both CPU and GPU backends, along with extension methods for converting to/from SkiaSharp and Xamarin.Forms types. Currently available for iOS, Android, UWP, macOS (preview) and Tizen (preview).

Changes

  • Initial support for WPF apps with Xamarin.Forms in the SkiaSharp.Views.Forms.WPF NuGet
  • Updated the version of Xamarin.Forms to v4.x
  • Added support for the mouse wheel on both SKCanvasView and SKGLView [@charlenni]

Links

NuGet | Changelog

HarfBuzzSharp

A library for text shaping, which is the process of converting Unicode text to glyph indices and positions.

Changes

  • Update HarfBuzzSharp to harfbuzz 2.6.1 [@Gillibald]
  • Added many, many new harfbuzz new APIs to finally make a complete harfbuzz binding [@Gillibald]
  • Added overloads and members that accept and return Span<T> in addition to the existing byte[] or IntPtr [@Gillibald]
  • Resolved an issue where the incorrect version of the native library was copied into the output of a Full Framework Xamarin.Mac app

Links

NuGet | Changelog

SkiaSharp.HarfBuzz (preview)

Support for text shaping using the HarfBuzz text shaping library. This package adds the SKShaper type that can shape a string, returning the codepoints and their positions.

This package also adds some extension methods to SKCanvas to make drawing shaped text easier. These methods include DrawShapedText and it's overloads.

Links

NuGet | Changelog

Linux

Because we love everyone in the Linux world just as well as the Microsoft and the Xamarin worlds, we have also included some pre-built Linux native binaries in a new, separate package (see #312):

SkiaSharp.NativeAssets.Linux
HarfBuzzSharp.NativeAssets.Linux

If you happen to be on an environment that does not have the ability to install any of the required dependencies, such as FontConfig, you can also try out the build that does not have any dependencies other that the core system libraries:

SkiaSharp.NativeAssets.Linux.NoDependencies

At the current time, it just contains a Ubuntu 16.04 amd64 build that should work on most Debian-based Linux distributions. More builds can be requested by leaving a comment on #453.

If a specific platform is required, you can easily build your own binaries by following this guide.

Samples

There are a large set of samples that show many different features of SkiaSharp. They are broken up into two main groups:

  • Basic - these are minimal samples that show just what is needed to use SkiaSharp
  • Gallery - these are comprehensive samples that show off new, or exciting features of SkiaSharp

All the samples that have been built and tested for this version of SkiaSharp can be downloaded in the "Assets" links.