Merge branch 'pdf-merge' into updating-samples
# Conflicts: # build.cake
This commit is contained in:
Коммит
7cbc7ee3c6
|
@ -92,7 +92,12 @@ namespace SkiaSharp
|
|||
}
|
||||
|
||||
public SKManagedStream (Stream managedStream, bool disposeManagedStream)
|
||||
: base (SkiaApi.sk_managedstream_new (), true)
|
||||
: this (managedStream, disposeManagedStream, true)
|
||||
{
|
||||
}
|
||||
|
||||
private SKManagedStream (Stream managedStream, bool disposeManagedStream, bool owns)
|
||||
: base (SkiaApi.sk_managedstream_new (), owns)
|
||||
{
|
||||
if (Handle == IntPtr.Zero) {
|
||||
throw new InvalidOperationException ("Unable to create a new SKManagedStream instance.");
|
||||
|
@ -240,7 +245,8 @@ namespace SkiaSharp
|
|||
private static IntPtr CreateNewInternal (IntPtr managedStreamPtr)
|
||||
{
|
||||
var managedStream = AsManagedStream (managedStreamPtr);
|
||||
var newStream = new SKManagedStream (managedStream.stream);
|
||||
var newStream = new SKManagedStream (managedStream.stream, false, false);
|
||||
managedStream.TakeOwnership (newStream);
|
||||
return newStream.Handle;
|
||||
}
|
||||
#if __IOS__
|
||||
|
|
|
@ -19,6 +19,7 @@ namespace SkiaSharp
|
|||
{
|
||||
private static readonly Dictionary<IntPtr, WeakReference> instances = new Dictionary<IntPtr, WeakReference>();
|
||||
|
||||
private readonly List<SKObject> ownedObjects = new List<SKObject>();
|
||||
private IntPtr handle;
|
||||
|
||||
[Preserve]
|
||||
|
@ -37,11 +38,7 @@ namespace SkiaSharp
|
|||
|
||||
~SKObject()
|
||||
{
|
||||
var h = handle;
|
||||
|
||||
Dispose(false);
|
||||
|
||||
DeregisterHandle(h, this);
|
||||
}
|
||||
|
||||
protected bool OwnsHandle { get; private set; }
|
||||
|
@ -58,21 +55,23 @@ namespace SkiaSharp
|
|||
|
||||
public void Dispose()
|
||||
{
|
||||
var h = handle;
|
||||
|
||||
Dispose(true);
|
||||
|
||||
if (h != IntPtr.Zero)
|
||||
{
|
||||
DeregisterHandle(h, this);
|
||||
handle = IntPtr.Zero;
|
||||
}
|
||||
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
lock (ownedObjects)
|
||||
{
|
||||
foreach (var child in ownedObjects)
|
||||
{
|
||||
child.Dispose();
|
||||
}
|
||||
ownedObjects.Clear();
|
||||
}
|
||||
|
||||
DeregisterHandle(handle, this);
|
||||
handle = IntPtr.Zero;
|
||||
}
|
||||
|
||||
internal static TSkiaObject GetObject<TSkiaObject>(IntPtr handle)
|
||||
|
@ -170,5 +169,14 @@ namespace SkiaSharp
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal void TakeOwnership(SKObject obj)
|
||||
{
|
||||
lock (ownedObjects)
|
||||
{
|
||||
ownedObjects.Add(obj);
|
||||
}
|
||||
obj.OwnsHandle = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,7 +53,9 @@ namespace SkiaSharp
|
|||
{
|
||||
if (stream == null)
|
||||
throw new ArgumentNullException ("stream");
|
||||
return GetObject<SKTypeface> (SkiaApi.sk_typeface_create_from_stream (stream.Handle, index));
|
||||
var typeface = GetObject<SKTypeface> (SkiaApi.sk_typeface_create_from_stream (stream.Handle, index));
|
||||
typeface?.TakeOwnership (stream);
|
||||
return typeface;
|
||||
}
|
||||
|
||||
public int CountGlyphs (string str)
|
||||
|
|
|
@ -42,7 +42,7 @@ fi
|
|||
# Download NuGet if it does not exist.
|
||||
if [ ! -f $NUGET_EXE ]; then
|
||||
echo "Downloading NuGet..."
|
||||
curl -Lsfo $NUGET_EXE https://dist.nuget.org/win-x86-commandline/v2.8.6/nuget.exe
|
||||
curl -Lsfo $NUGET_EXE https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "An error occured while downloading nuget.exe."
|
||||
exit 1
|
||||
|
|
17
build.cake
17
build.cake
|
@ -8,7 +8,7 @@ using System.Xml.Linq;
|
|||
|
||||
var TARGET = Argument ("t", Argument ("target", Argument ("Target", "Default")));
|
||||
|
||||
var NuGetSources = new [] { IsRunningOnWindows () ? "https://api.nuget.org/v3/index.json" : "https://www.nuget.org/api/v2/", "https://www.myget.org/F/xamprojectci/api/v2" };
|
||||
var NuGetSources = new [] { "https://api.nuget.org/v3/index.json", "https://www.myget.org/F/xamprojectci/api/v2" };
|
||||
var NugetToolPath = GetToolPath ("../nuget.exe");
|
||||
var XamarinComponentToolPath = GetToolPath ("../xamarin-component.exe");
|
||||
var CakeToolPath = GetToolPath ("Cake.exe");
|
||||
|
@ -855,13 +855,20 @@ Task ("component")
|
|||
|
||||
Task ("clean")
|
||||
.IsDependentOn ("clean-externals")
|
||||
.IsDependentOn ("clean-managed")
|
||||
.Does (() =>
|
||||
{
|
||||
CleanDirectories ("./binding/**/bin");
|
||||
CleanDirectories ("./binding/**/obj");
|
||||
});
|
||||
Task ("clean-managed").Does (() =>
|
||||
{
|
||||
CleanDirectories ("./binding/*/bin");
|
||||
CleanDirectories ("./binding/*/obj");
|
||||
|
||||
CleanDirectories ("./samples/**/bin");
|
||||
CleanDirectories ("./samples/**/obj");
|
||||
CleanDirectories ("./samples/*/bin");
|
||||
CleanDirectories ("./samples/*/obj");
|
||||
CleanDirectories ("./samples/*/*/bin");
|
||||
CleanDirectories ("./samples/*/*/obj");
|
||||
CleanDirectories ("./samples/*/packages");
|
||||
|
||||
CleanDirectories ("./tests/**/bin");
|
||||
CleanDirectories ("./tests/**/obj");
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<metadata>
|
||||
<id>SkiaSharp.Mac</id>
|
||||
<title>SkiaSharp for OSX</title>
|
||||
<version>1.49.4.0-beta</version>
|
||||
<version>1.49.4.0-beta3</version>
|
||||
<authors>Xamarin Inc.</authors>
|
||||
<owners>Xamarin Inc.</owners>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
|
@ -15,28 +15,28 @@
|
|||
</metadata>
|
||||
<files>
|
||||
<!-- the platform specific -->
|
||||
<file src="output/mac/SkiaSharp.dll" target="lib\net45" />
|
||||
<file src="output/mac/SkiaSharp.dll.config" target="lib\net45" />
|
||||
<file src="output/docs/msxml/SkiaSharp.xml" target="lib\net45" />
|
||||
<file src="output/android/SkiaSharp.dll" target="lib\MonoAndroid" />
|
||||
<file src="output/docs/msxml/SkiaSharp.xml" target="lib\MonoAndroid" />
|
||||
<file src="output/ios/SkiaSharp.dll" target="lib\XamariniOS" />
|
||||
<file src="output/docs/msxml/SkiaSharp.xml" target="lib\XamariniOS" />
|
||||
<file src="output/osx/SkiaSharp.dll" target="lib\XamarinMac" />
|
||||
<file src="output/docs/msxml/SkiaSharp.xml" target="lib\XamarinMac" />
|
||||
<file src="output/mac/SkiaSharp.dll" target="lib/net45" />
|
||||
<file src="output/mac/SkiaSharp.dll.config" target="lib/net45" />
|
||||
<file src="output/docs/msxml/SkiaSharp.xml" target="lib/net45" />
|
||||
<file src="output/android/SkiaSharp.dll" target="lib/MonoAndroid" />
|
||||
<file src="output/docs/msxml/SkiaSharp.xml" target="lib/MonoAndroid" />
|
||||
<file src="output/ios/SkiaSharp.dll" target="lib/XamariniOS" />
|
||||
<file src="output/docs/msxml/SkiaSharp.xml" target="lib/XamariniOS" />
|
||||
<file src="output/osx/SkiaSharp.dll" target="lib/XamarinMac" />
|
||||
<file src="output/docs/msxml/SkiaSharp.xml" target="lib/XamarinMac" />
|
||||
|
||||
<!-- the PCL -->
|
||||
<file src="output/portable/SkiaSharp.dll" target="lib\portable-net45+xamarinmac+xamarinios+monotouch+monoandroid+win8+wpa81+wp8+xamarin.watchos+xamarin.tvos" />
|
||||
<file src="output/docs/msxml/SkiaSharp.xml" target="lib\portable-net45+xamarinmac+xamarinios+monotouch+monoandroid+win8+wpa81+wp8+xamarin.watchos+xamarin.tvos" />
|
||||
<file src="output/portable/SkiaSharp.dll" target="lib/portable-net45+xamarinmac+xamarinios+monotouch+monoandroid+win8+wpa81+wp8+xamarin.watchos+xamarin.tvos" />
|
||||
<file src="output/docs/msxml/SkiaSharp.xml" target="lib/portable-net45+xamarinmac+xamarinios+monotouch+monoandroid+win8+wpa81+wp8+xamarin.watchos+xamarin.tvos" />
|
||||
|
||||
<!-- the build bits -->
|
||||
<!-- .NET 4.5 -->
|
||||
<file src="output/mac/SkiaSharp.Desktop.targets" target="build\net45\SkiaSharp.Mac.targets" />
|
||||
<file src="output/mac/SkiaSharp.Desktop.targets" target="build/net45/SkiaSharp.Mac.targets" />
|
||||
<!-- .NET 4.5 (OS X) -->
|
||||
<file src="output/mac/libSkiaSharp.dylib" target="build\net45\mac\libSkiaSharp.dylib" />
|
||||
<file src="output/mac/SkiaSharp.dll.config" target="build\net45\SkiaSharp.dll.config" />
|
||||
<file src="output/mac/libSkiaSharp.dylib" target="build/net45/mac/libSkiaSharp.dylib" />
|
||||
<file src="output/mac/SkiaSharp.dll.config" target="build/net45/SkiaSharp.dll.config" />
|
||||
<!-- OS X -->
|
||||
<file src="output/osx/SkiaSharp.OSX.targets" target="build\XamarinMac\SkiaSharp.Mac.targets" />
|
||||
<file src="output/osx/libSkiaSharp.dylib" target="build\XamarinMac\libSkiaSharp.dylib" />
|
||||
<file src="output/osx/SkiaSharp.OSX.targets" target="build/XamarinMac/SkiaSharp.Mac.targets" />
|
||||
<file src="output/osx/libSkiaSharp.dylib" target="build/XamarinMac/libSkiaSharp.dylib" />
|
||||
</files>
|
||||
</package>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<metadata>
|
||||
<id>SkiaSharp.Windows</id>
|
||||
<title>SkiaSharp for Windows</title>
|
||||
<version>1.49.4.0-beta</version>
|
||||
<version>1.49.4.0-beta3</version>
|
||||
<authors>Xamarin Inc.</authors>
|
||||
<owners>Xamarin Inc.</owners>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
|
@ -15,26 +15,26 @@
|
|||
</metadata>
|
||||
<files>
|
||||
<!-- the platform specific -->
|
||||
<file src="output/windows/SkiaSharp.dll" target="lib\net45" />
|
||||
<file src="output/windows/SkiaSharp.dll.config" target="lib\net45" />
|
||||
<file src="output/docs/msxml/SkiaSharp.xml" target="lib\net45" />
|
||||
<file src="output/uwp/SkiaSharp.dll" target="lib\uap10.0" />
|
||||
<file src="output/docs/msxml/SkiaSharp.xml" target="lib\uap10.0" />
|
||||
<file src="output/windows/SkiaSharp.dll" target="lib/net45" />
|
||||
<file src="output/windows/SkiaSharp.dll.config" target="lib/net45" />
|
||||
<file src="output/docs/msxml/SkiaSharp.xml" target="lib/net45" />
|
||||
<file src="output/uwp/SkiaSharp.dll" target="lib/uap10.0" />
|
||||
<file src="output/docs/msxml/SkiaSharp.xml" target="lib/uap10.0" />
|
||||
|
||||
<!-- the PCL -->
|
||||
<file src="output/portable/SkiaSharp.dll" target="lib\portable-net45+xamarinmac+xamarinios+monotouch+monoandroid+win8+wpa81+wp8+xamarin.watchos+xamarin.tvos" />
|
||||
<file src="output/docs/msxml/SkiaSharp.xml" target="lib\portable-net45+xamarinmac+xamarinios+monotouch+monoandroid+win8+wpa81+wp8+xamarin.watchos+xamarin.tvos" />
|
||||
<file src="output/portable/SkiaSharp.dll" target="lib/portable-net45+xamarinmac+xamarinios+monotouch+monoandroid+win8+wpa81+wp8+xamarin.watchos+xamarin.tvos" />
|
||||
<file src="output/docs/msxml/SkiaSharp.xml" target="lib/portable-net45+xamarinmac+xamarinios+monotouch+monoandroid+win8+wpa81+wp8+xamarin.watchos+xamarin.tvos" />
|
||||
|
||||
<!-- the build bits -->
|
||||
<!-- .NET 4.5 -->
|
||||
<file src="output/windows/SkiaSharp.Desktop.targets" target="build\net45\SkiaSharp.Windows.targets" />
|
||||
<file src="output/windows/SkiaSharp.Desktop.targets" target="build/net45/SkiaSharp.Windows.targets" />
|
||||
<!-- .NET 4.5 (Windows) -->
|
||||
<file src="output/windows/x64/libSkiaSharp.dll" target="build\net45\x64\libSkiaSharp.dll" />
|
||||
<file src="output/windows/x86/libSkiaSharp.dll" target="build\net45\x86\libSkiaSharp.dll" />
|
||||
<file src="output/windows/x64/libSkiaSharp.dll" target="build/net45/x64/libSkiaSharp.dll" />
|
||||
<file src="output/windows/x86/libSkiaSharp.dll" target="build/net45/x86/libSkiaSharp.dll" />
|
||||
<!-- UWP -->
|
||||
<file src="output/uwp/SkiaSharp.UWP.targets" target="build\uap10.0\SkiaSharp.Windows.targets" />
|
||||
<file src="output/uwp/x64/libSkiaSharp.dll" target="build\uap10.0\x64\libSkiaSharp.dll" />
|
||||
<file src="output/uwp/x86/libSkiaSharp.dll" target="build\uap10.0\x86\libSkiaSharp.dll" />
|
||||
<file src="output/uwp/arm/libSkiaSharp.dll" target="build\uap10.0\arm\libSkiaSharp.dll" />
|
||||
<file src="output/uwp/SkiaSharp.UWP.targets" target="build/uap10.0/SkiaSharp.Windows.targets" />
|
||||
<file src="output/uwp/x64/libSkiaSharp.dll" target="build/uap10.0/x64/libSkiaSharp.dll" />
|
||||
<file src="output/uwp/x86/libSkiaSharp.dll" target="build/uap10.0/x86/libSkiaSharp.dll" />
|
||||
<file src="output/uwp/arm/libSkiaSharp.dll" target="build/uap10.0/arm/libSkiaSharp.dll" />
|
||||
</files>
|
||||
</package>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<metadata>
|
||||
<id>SkiaSharp</id>
|
||||
<title>SkiaSharp</title>
|
||||
<version>1.49.4.0-beta</version>
|
||||
<version>1.49.4.0-beta3</version>
|
||||
<authors>Xamarin Inc.</authors>
|
||||
<owners>Xamarin Inc.</owners>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
|
@ -15,38 +15,38 @@
|
|||
</metadata>
|
||||
<files>
|
||||
<!-- the platform specific -->
|
||||
<file src="output/mac/SkiaSharp.dll" target="lib\net45" />
|
||||
<file src="output/mac/SkiaSharp.dll.config" target="lib\net45" />
|
||||
<file src="output/docs/msxml/SkiaSharp.xml" target="lib\net45" />
|
||||
<file src="output/android/SkiaSharp.dll" target="lib\MonoAndroid" />
|
||||
<file src="output/docs/msxml/SkiaSharp.xml" target="lib\MonoAndroid" />
|
||||
<file src="output/ios/SkiaSharp.dll" target="lib\XamariniOS" />
|
||||
<file src="output/docs/msxml/SkiaSharp.xml" target="lib\XamariniOS" />
|
||||
<file src="output/osx/SkiaSharp.dll" target="lib\XamarinMac" />
|
||||
<file src="output/docs/msxml/SkiaSharp.xml" target="lib\XamarinMac" />
|
||||
<file src="output/uwp/SkiaSharp.dll" target="lib\uap10.0" />
|
||||
<file src="output/docs/msxml/SkiaSharp.xml" target="lib\uap10.0" />
|
||||
<file src="output/mac/SkiaSharp.dll" target="lib/net45" />
|
||||
<file src="output/mac/SkiaSharp.dll.config" target="lib/net45" />
|
||||
<file src="output/docs/msxml/SkiaSharp.xml" target="lib/net45" />
|
||||
<file src="output/android/SkiaSharp.dll" target="lib/MonoAndroid" />
|
||||
<file src="output/docs/msxml/SkiaSharp.xml" target="lib/MonoAndroid" />
|
||||
<file src="output/ios/SkiaSharp.dll" target="lib/XamariniOS" />
|
||||
<file src="output/docs/msxml/SkiaSharp.xml" target="lib/XamariniOS" />
|
||||
<file src="output/osx/SkiaSharp.dll" target="lib/XamarinMac" />
|
||||
<file src="output/docs/msxml/SkiaSharp.xml" target="lib/XamarinMac" />
|
||||
<file src="output/uwp/SkiaSharp.dll" target="lib/uap10.0" />
|
||||
<file src="output/docs/msxml/SkiaSharp.xml" target="lib/uap10.0" />
|
||||
|
||||
<!-- the PCL -->
|
||||
<file src="output/portable/SkiaSharp.dll" target="lib\portable-net45+xamarinmac+xamarinios+monotouch+monoandroid+win8+wpa81+wp8+xamarin.watchos+xamarin.tvos" />
|
||||
<file src="output/docs/msxml/SkiaSharp.xml" target="lib\portable-net45+xamarinmac+xamarinios+monotouch+monoandroid+win8+wpa81+wp8+xamarin.watchos+xamarin.tvos" />
|
||||
<file src="output/portable/SkiaSharp.dll" target="lib/portable-net45+xamarinmac+xamarinios+monotouch+monoandroid+win8+wpa81+wp8+xamarin.watchos+xamarin.tvos" />
|
||||
<file src="output/docs/msxml/SkiaSharp.xml" target="lib/portable-net45+xamarinmac+xamarinios+monotouch+monoandroid+win8+wpa81+wp8+xamarin.watchos+xamarin.tvos" />
|
||||
|
||||
<!-- the build bits -->
|
||||
<!-- .NET 4.5 -->
|
||||
<file src="output/mac/SkiaSharp.Desktop.targets" target="build\net45\SkiaSharp.targets" />
|
||||
<file src="output/mac/SkiaSharp.Desktop.targets" target="build/net45/SkiaSharp.targets" />
|
||||
<!-- .NET 4.5 (Windows) -->
|
||||
<file src="output/windows/x64/libSkiaSharp.dll" target="build\net45\x64\libSkiaSharp.dll" />
|
||||
<file src="output/windows/x86/libSkiaSharp.dll" target="build\net45\x86\libSkiaSharp.dll" />
|
||||
<file src="output/windows/x64/libSkiaSharp.dll" target="build/net45/x64/libSkiaSharp.dll" />
|
||||
<file src="output/windows/x86/libSkiaSharp.dll" target="build/net45/x86/libSkiaSharp.dll" />
|
||||
<!-- .NET 4.5 (OS X) -->
|
||||
<file src="output/mac/libSkiaSharp.dylib" target="build\net45\mac\libSkiaSharp.dylib" />
|
||||
<file src="output/mac/SkiaSharp.dll.config" target="build\net45\SkiaSharp.dll.config" />
|
||||
<file src="output/mac/libSkiaSharp.dylib" target="build/net45/mac/libSkiaSharp.dylib" />
|
||||
<file src="output/mac/SkiaSharp.dll.config" target="build/net45/SkiaSharp.dll.config" />
|
||||
<!-- OS X -->
|
||||
<file src="output/osx/SkiaSharp.OSX.targets" target="build\XamarinMac\SkiaSharp.targets" />
|
||||
<file src="output/osx/libSkiaSharp.dylib" target="build\XamarinMac\libSkiaSharp.dylib" />
|
||||
<file src="output/osx/SkiaSharp.OSX.targets" target="build/XamarinMac/SkiaSharp.targets" />
|
||||
<file src="output/osx/libSkiaSharp.dylib" target="build/XamarinMac/libSkiaSharp.dylib" />
|
||||
<!-- UWP -->
|
||||
<file src="output/uwp/SkiaSharp.UWP.targets" target="build\uap10.0\SkiaSharp.targets" />
|
||||
<file src="output/uwp/x64/libSkiaSharp.dll" target="build\uap10.0\x64\libSkiaSharp.dll" />
|
||||
<file src="output/uwp/x86/libSkiaSharp.dll" target="build\uap10.0\x86\libSkiaSharp.dll" />
|
||||
<file src="output/uwp/arm/libSkiaSharp.dll" target="build\uap10.0\arm\libSkiaSharp.dll" />
|
||||
<file src="output/uwp/SkiaSharp.UWP.targets" target="build/uap10.0/SkiaSharp.targets" />
|
||||
<file src="output/uwp/x64/libSkiaSharp.dll" target="build/uap10.0/x64/libSkiaSharp.dll" />
|
||||
<file src="output/uwp/x86/libSkiaSharp.dll" target="build/uap10.0/x86/libSkiaSharp.dll" />
|
||||
<file src="output/uwp/arm/libSkiaSharp.dll" target="build/uap10.0/arm/libSkiaSharp.dll" />
|
||||
</files>
|
||||
</package>
|
||||
|
|
Загрузка…
Ссылка в новой задаче