Browse Source
Merge branch 'master' into x11-mate-clipboard
pull/12002/head
viordash
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
8 additions and
10 deletions
src/Avalonia.Base/Rendering/Composition/CompositionExternalMemory.cs
src/Avalonia.Base/Rendering/Composition/CompositionInterop.cs
src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionDrawingSurface.cs
src/Avalonia.Base/Rendering/Composition/readme.md
@ -91,7 +91,8 @@ public interface ICompositionGpuImportedObject : IAsyncDisposable
/// the user code is allowed to free the resource owner in case when a non-owning
/// sharing handle was used
/// </summary>
Task ImportCompeted { get ; }
Task ImportCompleted { get ; }
/// <summary>
/// Indicates if the device context this instance is associated with is no longer available
/// </summary>
@ -67,18 +67,18 @@ abstract class CompositionGpuImportedObjectBase : ICompositionGpuImportedObject
Context = context ;
Feature = feature ;
ImportCompeted = Compositor . InvokeServerJobAsync ( Import ) ;
ImportCompl eted = Compositor . InvokeServerJobAsync ( Import ) ;
}
protected abstract void Import ( ) ;
public abstract void Dispose ( ) ;
public Task ImportCompeted { get ; }
public Task ImportCompl eted { get ; }
public bool IsLost = > Context . IsLost ;
public ValueTask DisposeAsync ( ) = > new ( Compositor . InvokeServerJobAsync ( ( ) = >
{
if ( ImportCompeted . Status = = TaskStatus . RanToCompletion )
if ( ImportCompl eted . Status = = TaskStatus . RanToCompletion )
Dispose ( ) ;
} ) ) ;
}
@ -31,12 +31,12 @@ internal class ServerCompositionDrawingSurface : ServerCompositionSurface, IDisp
throw new PlatformGraphicsContextLostException ( ) ;
// This should never happen, but check for it anyway to avoid a deadlock
if ( ! image . ImportCompeted . IsCompleted )
if ( ! image . ImportCompl eted . IsCompleted )
throw new InvalidOperationException ( "The import operation is not completed yet" ) ;
// Rethrow the import here exception
if ( image . ImportCompeted . IsFaulted )
image . ImportCompeted . GetAwaiter ( ) . GetResult ( ) ;
if ( image . ImportCompl eted . IsFaulted )
image . ImportCompl eted . GetAwaiter ( ) . GetResult ( ) ;
}
void Update ( IBitmapImpl newImage , IPlatformRenderInterfaceContext context )
@ -1,3 +0,0 @@
Please note the composition renderer is not subject to the usual MIT license.
Please contact us for more details and see [License.md ](https://raw.githubusercontent.com/AvaloniaUI/Avalonia/master/src/Avalonia.Base/Rendering/Composition/License.md )