This commit is contained in:
Matthew Leibowitz 2018-01-31 23:31:34 +02:00
Родитель 06bef73cfe
Коммит f693607d08
3 изменённых файлов: 36 добавлений и 22 удалений

Просмотреть файл

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{17521786-7B50-46C5-BBCE-999FDEBB45A3}</ProjectGuid>
<OutputType>WinExe</OutputType>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
@ -29,8 +31,6 @@
<Reference Include="glade-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\binding\SkiaSharp.Desktop\SkiaSharp.Desktop.csproj">

Просмотреть файл

@ -21,6 +21,8 @@ namespace SkiaSharp.Views.Gtk
protected override bool OnExposeEvent(Gdk.EventExpose evnt)
{
var result = base.OnExposeEvent(evnt);
var window = evnt.Window;
var area = evnt.Area;
@ -50,7 +52,7 @@ namespace SkiaSharp.Views.Gtk
window.Clear();
window.DrawPixbuf(null, pix, 0, 0, 0, 0, -1, -1, Gdk.RgbDither.None, 0, 0);
return true;
return result;
}
protected virtual void OnPaintSurface(SKPaintSurfaceEventArgs e)
@ -59,13 +61,35 @@ namespace SkiaSharp.Views.Gtk
PaintSurface?.Invoke(this, e);
}
~SKWidget()
{
Dispose(false);
}
public override void Destroy()
{
GC.SuppressFinalize(this);
Dispose(true);
base.Destroy();
}
public override void Dispose()
{
FreePixbuf();
GC.SuppressFinalize(this);
Dispose(true);
base.Dispose();
}
public virtual void Dispose(bool disposing)
{
if (disposing)
{
FreePixbuf();
}
}
private void CreatePixbuf()
{
var alloc = Allocation;

Просмотреть файл

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{67A502A4-E8B2-419A-811E-5A634B29C8D7}</ProjectGuid>
<OutputType>Library</OutputType>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
@ -29,24 +31,12 @@
<ItemGroup>
<Reference Include="System" />
<Reference Include="Mono.Posix" />
<Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<Package>gtk-sharp-2.0</Package>
</Reference>
<Reference Include="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<Package>gtk-sharp-2.0</Package>
</Reference>
<Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<Package>glib-sharp-2.0</Package>
</Reference>
<Reference Include="glade-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<Package>glade-sharp-2.0</Package>
</Reference>
<Reference Include="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<Package>gtk-sharp-2.0</Package>
</Reference>
<Reference Include="atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<Package>gtk-sharp-2.0</Package>
</Reference>
<Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="glade-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\binding\SkiaSharp.Desktop\SkiaSharp.Desktop.csproj">