Browse Source

Merge branch 'master' into set-test-root-child-once

pull/12094/head
Max Katz 3 years ago
committed by GitHub
parent
commit
2042918fbf
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      readme.md
  2. 3
      src/Avalonia.Base/Rendering/Composition/CompositionExternalMemory.cs
  3. 6
      src/Avalonia.Base/Rendering/Composition/CompositionInterop.cs
  4. 6
      src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionDrawingSurface.cs

2
readme.md

@ -10,7 +10,7 @@
[Avalonia](https://avaloniaui.net) is a cross-platform UI framework for dotnet, providing a flexible styling system and supporting a wide range of platforms such as Windows, macOS, Linux, iOS, Android and WebAssembly. Avalonia is mature and production ready and is used by companies, including [Schneider Electric](https://avaloniaui.net/showcase#se), [Unity](https://avaloniaui.net/showcase#unity), [JetBrains](https://avaloniaui.net/showcase#rider) and [Github](https://avaloniaui.net/showcase#github). [Avalonia](https://avaloniaui.net) is a cross-platform UI framework for dotnet, providing a flexible styling system and supporting a wide range of platforms such as Windows, macOS, Linux, iOS, Android and WebAssembly. Avalonia is mature and production ready and is used by companies, including [Schneider Electric](https://avaloniaui.net/showcase#se), [Unity](https://avaloniaui.net/showcase#unity), [JetBrains](https://avaloniaui.net/showcase#rider) and [Github](https://avaloniaui.net/showcase#github).
Considered by many to be the spiritual successor to WPF, Avalonia UI provides a familiar, modern development experience for XAML developers creating cross-platform applications. While Avalonia UI is [similar to WPF](https://docs.avaloniaui.net/misc/wpf), it isn't a 1:1 copy, and you'll find plenty of improvements. Considered by many to be the spiritual successor to WPF, Avalonia UI provides a familiar, modern development experience for XAML developers creating cross-platform applications. While Avalonia UI is [similar to WPF](https://docs.avaloniaui.net/docs/next/get-started/wpf/), it isn't a 1:1 copy, and you'll find plenty of improvements.
For those seeking a cross-platform WPF, we have created [Avalonia XPF](https://avaloniaui.net/xpf), enabling WPF applications to run on macOS and Linux with little to no code changes. Avalonia XPF is a commercial product and is licensed per-app, per-platform. For those seeking a cross-platform WPF, we have created [Avalonia XPF](https://avaloniaui.net/xpf), enabling WPF applications to run on macOS and Linux with little to no code changes. Avalonia XPF is a commercial product and is licensed per-app, per-platform.

3
src/Avalonia.Base/Rendering/Composition/CompositionExternalMemory.cs

@ -91,8 +91,7 @@ public interface ICompositionGpuImportedObject : IAsyncDisposable
/// the user code is allowed to free the resource owner in case when a non-owning /// the user code is allowed to free the resource owner in case when a non-owning
/// sharing handle was used /// sharing handle was used
/// </summary> /// </summary>
Task ImportCompleted { get; } Task ImportCompeted { get; }
/// <summary> /// <summary>
/// Indicates if the device context this instance is associated with is no longer available /// Indicates if the device context this instance is associated with is no longer available
/// </summary> /// </summary>

6
src/Avalonia.Base/Rendering/Composition/CompositionInterop.cs

@ -67,18 +67,18 @@ abstract class CompositionGpuImportedObjectBase : ICompositionGpuImportedObject
Context = context; Context = context;
Feature = feature; Feature = feature;
ImportCompleted = Compositor.InvokeServerJobAsync(Import); ImportCompeted = Compositor.InvokeServerJobAsync(Import);
} }
protected abstract void Import(); protected abstract void Import();
public abstract void Dispose(); public abstract void Dispose();
public Task ImportCompleted { get; } public Task ImportCompeted { get; }
public bool IsLost => Context.IsLost; public bool IsLost => Context.IsLost;
public ValueTask DisposeAsync() => new(Compositor.InvokeServerJobAsync(() => public ValueTask DisposeAsync() => new(Compositor.InvokeServerJobAsync(() =>
{ {
if (ImportCompleted.Status == TaskStatus.RanToCompletion) if (ImportCompeted.Status == TaskStatus.RanToCompletion)
Dispose(); Dispose();
})); }));
} }

6
src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionDrawingSurface.cs

@ -31,12 +31,12 @@ internal class ServerCompositionDrawingSurface : ServerCompositionSurface, IDisp
throw new PlatformGraphicsContextLostException(); throw new PlatformGraphicsContextLostException();
// This should never happen, but check for it anyway to avoid a deadlock // This should never happen, but check for it anyway to avoid a deadlock
if (!image.ImportCompleted.IsCompleted) if (!image.ImportCompeted.IsCompleted)
throw new InvalidOperationException("The import operation is not completed yet"); throw new InvalidOperationException("The import operation is not completed yet");
// Rethrow the import here exception // Rethrow the import here exception
if (image.ImportCompleted.IsFaulted) if (image.ImportCompeted.IsFaulted)
image.ImportCompleted.GetAwaiter().GetResult(); image.ImportCompeted.GetAwaiter().GetResult();
} }
void Update(IBitmapImpl newImage, IPlatformRenderInterfaceContext context) void Update(IBitmapImpl newImage, IPlatformRenderInterfaceContext context)

Loading…
Cancel
Save