Max Katz
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
7 additions and
7 deletions
-
src/Windows/Avalonia.Win32.Interop/Avalonia.Win32.Interop.csproj
-
src/Windows/Avalonia.Win32.Interop/Wpf/WpfTopLevelImpl.cs
-
src/Windows/Avalonia.Win32.Interop/Wpf/WritableBitmapSurface.cs
-
src/Windows/Avalonia.Win32/Avalonia.Win32.csproj
|
|
|
@ -13,9 +13,6 @@ |
|
|
|
<ProjectReference Include="..\Avalonia.Win32\Avalonia.Win32.csproj" /> |
|
|
|
<ProjectReference Include="..\Avalonia.Direct2D1\Avalonia.Direct2D1.csproj" /> |
|
|
|
</ItemGroup> |
|
|
|
<ItemGroup> |
|
|
|
<Compile Include="..\Avalonia.Win32\Interop\UnmanagedMethods.cs" Link="UnmanagedMethods.cs" /> |
|
|
|
</ItemGroup> |
|
|
|
|
|
|
|
<Import Project="..\..\..\build\SharpDX.props" /> |
|
|
|
<Import Project="..\..\..\build\DevAnalyzers.props" /> |
|
|
|
|
|
|
|
@ -12,6 +12,7 @@ using Avalonia.Input.Raw; |
|
|
|
using Avalonia.Layout; |
|
|
|
using Avalonia.Platform; |
|
|
|
using Avalonia.Rendering; |
|
|
|
using Avalonia.Rendering.Composition; |
|
|
|
using Key = Avalonia.Input.Key; |
|
|
|
using KeyEventArgs = System.Windows.Input.KeyEventArgs; |
|
|
|
using MouseButton = System.Windows.Input.MouseButton; |
|
|
|
@ -90,8 +91,7 @@ namespace Avalonia.Win32.Interop.Wpf |
|
|
|
|
|
|
|
public IRenderer CreateRenderer(IRenderRoot root) |
|
|
|
{ |
|
|
|
var mgr = new PlatformRenderInterfaceContextManager(null); |
|
|
|
return new ImmediateRenderer((Visual)root, () => mgr.CreateRenderTarget(_surfaces), mgr); |
|
|
|
return new CompositingRenderer(root, Win32Platform.Compositor, () => _surfaces); |
|
|
|
} |
|
|
|
|
|
|
|
public void Dispose() |
|
|
|
@ -134,7 +134,7 @@ namespace Avalonia.Win32.Interop.Wpf |
|
|
|
drawingContext.DrawImage(ImageSource, new System.Windows.Rect(0, 0, ActualWidth, ActualHeight)); |
|
|
|
} |
|
|
|
|
|
|
|
void ITopLevelImpl.Invalidate(Rect rect) => InvalidateVisual(); |
|
|
|
|
|
|
|
|
|
|
|
void ITopLevelImpl.SetInputRoot(IInputRoot inputRoot) => _inputRoot = inputRoot; |
|
|
|
|
|
|
|
|
|
|
|
@ -25,7 +25,7 @@ namespace Avalonia.Win32.Interop.Wpf |
|
|
|
if (_bitmap == null || _bitmap.PixelWidth != (int) size.Width || _bitmap.PixelHeight != (int) size.Height) |
|
|
|
{ |
|
|
|
_bitmap = new WriteableBitmap((int) size.Width, (int) size.Height, dpi.X, dpi.Y, |
|
|
|
PixelFormats.Bgra32, null); |
|
|
|
System.Windows.Media.PixelFormats.Bgra32, null); |
|
|
|
} |
|
|
|
return new LockedFramebuffer(_impl, _bitmap, dpi); |
|
|
|
} |
|
|
|
|
|
|
|
@ -27,4 +27,7 @@ |
|
|
|
<PropertyGroup Label="Warnings"> |
|
|
|
<NoWarn>$(NoWarn);CA1416</NoWarn> |
|
|
|
</PropertyGroup> |
|
|
|
<ItemGroup> |
|
|
|
<InternalsVisibleTo Include="Avalonia.Win32.Interop, PublicKey=$(AvaloniaPublicKey)"/> |
|
|
|
</ItemGroup> |
|
|
|
</Project> |
|
|
|
|