diff --git a/api/Avalonia.nupkg.xml b/api/Avalonia.nupkg.xml
new file mode 100644
index 0000000000..6a7d53544e
--- /dev/null
+++ b/api/Avalonia.nupkg.xml
@@ -0,0 +1,10 @@
+
+
+
+
+ CP0006
+ P:Avalonia.Rendering.Composition.ICompositionGpuImportedObject.ImportCompleted
+ baseline/netstandard2.0/Avalonia.Base.dll
+ target/netstandard2.0/Avalonia.Base.dll
+
+
\ No newline at end of file
diff --git a/src/Avalonia.Base/Rendering/Composition/CompositionExternalMemory.cs b/src/Avalonia.Base/Rendering/Composition/CompositionExternalMemory.cs
index ce728f86a2..31cbaf2a29 100644
--- a/src/Avalonia.Base/Rendering/Composition/CompositionExternalMemory.cs
+++ b/src/Avalonia.Base/Rendering/Composition/CompositionExternalMemory.cs
@@ -1,10 +1,13 @@
using System;
using System.Collections.Generic;
+using System.ComponentModel;
using System.Threading.Tasks;
using Avalonia.Metadata;
using Avalonia.Platform;
namespace Avalonia.Rendering.Composition;
+
+[NotClientImplementable]
public interface ICompositionGpuInterop
{
///
@@ -84,14 +87,22 @@ public enum CompositionGpuImportedImageSynchronizationCapabilities
///
/// An imported GPU object that's usable by composition APIs
///
+[NotClientImplementable]
public interface ICompositionGpuImportedObject : IAsyncDisposable
{
///
/// Tracks the import status of the object. Once the task is completed,
/// the user code is allowed to free the resource owner in case when a non-owning
- /// sharing handle was used
+ /// sharing handle was used.
///
+ Task ImportCompleted { get; }
+
+ ///
+ /// ImportCompleted (recommended replacement)
+ [Obsolete("Please use ICompositionGpuImportedObject.ImportCompleted instead")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
Task ImportCompeted { get; }
+
///
/// Indicates if the device context this instance is associated with is no longer available
///
diff --git a/src/Avalonia.Base/Rendering/Composition/CompositionInterop.cs b/src/Avalonia.Base/Rendering/Composition/CompositionInterop.cs
index 1643ec6e8d..12a252ed96 100644
--- a/src/Avalonia.Base/Rendering/Composition/CompositionInterop.cs
+++ b/src/Avalonia.Base/Rendering/Composition/CompositionInterop.cs
@@ -67,18 +67,20 @@ abstract class CompositionGpuImportedObjectBase : ICompositionGpuImportedObject
Context = context;
Feature = feature;
- ImportCompeted = Compositor.InvokeServerJobAsync(Import);
+ ImportCompleted = Compositor.InvokeServerJobAsync(Import);
}
protected abstract void Import();
public abstract void Dispose();
- public Task ImportCompeted { get; }
+ public Task ImportCompleted { get; }
+
+ public Task ImportCompeted => ImportCompleted;
public bool IsLost => Context.IsLost;
public ValueTask DisposeAsync() => new(Compositor.InvokeServerJobAsync(() =>
{
- if (ImportCompeted.Status == TaskStatus.RanToCompletion)
+ if (ImportCompleted.Status == TaskStatus.RanToCompletion)
Dispose();
}));
}
diff --git a/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionDrawingSurface.cs b/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionDrawingSurface.cs
index da24b3812a..f58403f0bc 100644
--- a/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionDrawingSurface.cs
+++ b/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionDrawingSurface.cs
@@ -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.ImportCompleted.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.ImportCompleted.IsFaulted)
+ image.ImportCompleted.GetAwaiter().GetResult();
}
void Update(IBitmapImpl newImage, IPlatformRenderInterfaceContext context)