2015-11-13 18:21:00 +03:00
# SkiaSharp
2015-11-14 07:33:17 +03:00
2016-11-22 04:42:21 +03:00
[![Gitter.im ](https://img.shields.io/badge/gitter.im-xamarin%2FXamarinComponents-E60256.svg )](https://gitter.im/xamarin/XamarinComponents) [![NuGet Pre Release ](https://img.shields.io/nuget/vpre/SkiaSharp.svg?maxAge=2592000&label=SkiaSharp%20NuGet )](https://www.nuget.org/packages/SkiaSharp) [![SkiaSharp.Views ](https://img.shields.io/nuget/vpre/SkiaSharp.Views.svg?maxAge=2592000&label=SkiaSharp.Views%20NuGet )](https://www.nuget.org/packages/SkiaSharp.Views) [![SkiaSharp.Views.Forms ](https://img.shields.io/nuget/vpre/SkiaSharp.Views.Forms.svg?maxAge=2592000&label=SkiaSharp.Views.Forms%20NuGet )](https://www.nuget.org/packages/SkiaSharp.Views.Forms)
2016-05-15 00:40:40 +03:00
2016-04-07 18:13:46 +03:00
SkiaSharp is a cross-platform 2D graphics API for .NET platforms based on Google's
Skia Graphics Library (https://skia.org/). It provides a comprehensive 2D API that can
be used across mobile, server and desktop models to render images.
2015-11-14 07:33:17 +03:00
2016-02-22 19:22:29 +03:00
## What is Included
2015-11-14 07:33:17 +03:00
2016-02-23 00:04:36 +03:00
SkiaSharp provides a PCL and platform-specific bindings for:
2015-11-14 07:33:17 +03:00
2016-07-29 20:17:04 +03:00
- Mac (Console or using the Xamarin.Mac)
2016-02-22 19:22:29 +03:00
- Xamarin.Android
- Xamarin.iOS
2016-06-10 00:27:03 +03:00
- Xamarin.tvOS
2016-07-29 20:17:04 +03:00
- Xamarin.Mac
2016-08-12 12:21:36 +03:00
- Windows Desktop (Windows.Forms / WPF)
2016-05-12 03:27:03 +03:00
- Windows UWP
2016-02-22 19:22:29 +03:00
2016-02-22 21:44:17 +03:00
You can also build this on your particular variant of Unix
to create your native libraries.
2016-02-22 19:22:29 +03:00
2016-02-23 19:48:23 +03:00
## Using SkiaSharp
2016-02-22 19:22:29 +03:00
2016-08-11 06:22:51 +03:00
SkiaSharp is available as a convenience NuGet package, to use install the package like this:
```
nuget install SkiaSharp
```
Our [getting started guide ](https://developer.xamarin.com/guides/cross-platform/drawing/ ) will walk you
through both the basic setup as well as the platform specific capabilties.
The [API Documentation ](https://developer.xamarin.com/api/namespace/SkiaSharp/ ) is also available on the
web to browse.
2016-02-22 19:22:29 +03:00
2016-08-15 19:59:42 +03:00
### Prerequisites
Make sure the [Microsoft Visual C++ 2015 Redistributable ](https://www.microsoft.com/en-us/download/details.aspx?id=52982 ) is installed if this error occurs:
> Unable to load DLL 'libSkiaSharp.dll': The specified module could not be found.
2016-02-23 19:48:23 +03:00
## Building SkiaSharp
2016-04-08 21:58:02 +03:00
First clone the repository:
$ git clone https://github.com/mono/SkiaSharp.git
Next, set up the submodules:
$ cd SkiaSharp
$ git submodule init & & git submodule update
Then follow the platform-specific instructions below.
2016-03-01 12:30:33 +03:00
### Mac OS X
Run from Bash
2016-02-23 19:48:23 +03:00
$ ./bootstrapper.sh -t libs
2016-06-28 16:07:00 +03:00
This runs the build process by using the `libs` build target.
2016-03-01 12:30:33 +03:00
### Windows
2016-05-12 03:33:39 +03:00
You need Python 2.7 in `PATH` environment variable. Then you can build it:
2016-02-23 19:48:23 +03:00
> .\bootstrapper.ps1 -Target libs
2016-06-28 16:07:00 +03:00
This runs the build process by using the `libs` build target.
2016-05-17 17:36:29 +03:00
### Build Targets
2016-03-01 12:30:33 +03:00
2016-06-28 16:07:00 +03:00
There are several targets available, you can specify the target as the argument to the `-t` command line
option in the bootstrapper script.
2016-02-23 19:48:23 +03:00
2016-06-10 00:27:03 +03:00
- `Everything` - builds everything for the current platform
2016-02-23 19:48:23 +03:00
- `externals` - builds all the native libraries
- [win] `externals-windows` - builds the native libraries for Windows
2016-05-12 03:27:03 +03:00
- [win] `externals-uwp` - builds the native libraries for Windows UWP
2016-02-23 19:48:23 +03:00
- [mac] `externals-osx` - builds the native libraries for Mac OS X
- [mac] `externals-ios` - builds the native libraries for iOS
2016-06-10 00:27:03 +03:00
- [mac] `externals-tvos` - builds the native libraries for tvOS
2016-02-23 19:48:23 +03:00
- [mac] `externals-andoid` - builds the native libraries for Android
- `libs` - builds all the managed libraries
- [win] `libs-windows` - builds the managed libraries that can be built on Windows
- [mac] `libs-osx` - builds the managed libraries that can be built on Mac OS X
- `tests` - builds and runs the tests
- `samples` - builds the samples available for the current platform
- `docs` - updates the mdoc files
- `nuget` - packages the libraries into a NuGet
2016-04-08 17:48:01 +03:00
- `clean` - cleans everything
- `clean-externals` - cleans externals only
2016-06-10 00:27:03 +03:00
- `clean-managed` - cleans managed libraries/samples only
2016-02-23 19:48:23 +03:00
2016-10-24 17:28:12 +03:00
## New Skia Features Roadmap
Google has created a [nice doc with a collection of high level items ](https://docs.google.com/document/d/1C9w8qpPpdgNGThqmgNnTToLZ5UYK4TsUGl5X3B_q6oM/edit )
they have on tap the next 6-12 months. Note it is a living document that changes based on the requirements of the library's users.
2016-05-17 17:36:29 +03:00
## Compare Code
Here are some links to show the differences in our code as compared to Google's.
2016-10-12 05:59:24 +03:00
What version are we on? [**m55** ](https://github.com/google/skia/tree/chrome/m55 )
2016-10-29 14:47:24 +03:00
Are we up-to-date with Google? [Compare ](https://github.com/mono/skia/compare/xamarin-mobile-bindings...google:chrome/m55 )
What have we added? [Compare ](https://github.com/google/skia/compare/chrome/m55...mono:xamarin-mobile-bindings )
2016-06-17 23:54:08 +03:00
2016-06-10 00:27:03 +03:00
## Where is Windows Phone 8 / Store 8
2016-02-22 19:22:29 +03:00
2016-03-08 00:55:02 +03:00
We are working to add binaries for these platforms, stay tuned for a future release
(or check the pull requests and branches, where we are working on those)