Merge multiple interfaces related to rendering (#20557)
* Merge ISkiaGpuWithPlatformGraphicsContext into ISkiaGpu * Merge ISkiaGpuRenderTarget2 into ISkiaGpuRenderTarget * Merge IRenderTarget2 into IRenderTarget * Update API suppressions * Update API suppressions
This commit is contained in:
committed by
GitHub
parent
61f8103726
commit
7d0c2264f5
@@ -1,6 +1,78 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- https://learn.microsoft.com/dotnet/fundamentals/package-validation/diagnostic-ids -->
|
||||
<Suppressions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0001</DiagnosticId>
|
||||
<Target>T:Avalonia.Skia.ISkiaGpuRenderTarget2</Target>
|
||||
<Left>baseline/Avalonia.Skia/lib/net10.0/Avalonia.Skia.dll</Left>
|
||||
<Right>current/Avalonia.Skia/lib/net10.0/Avalonia.Skia.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0001</DiagnosticId>
|
||||
<Target>T:Avalonia.Skia.ISkiaGpuWithPlatformGraphicsContext</Target>
|
||||
<Left>baseline/Avalonia.Skia/lib/net10.0/Avalonia.Skia.dll</Left>
|
||||
<Right>current/Avalonia.Skia/lib/net10.0/Avalonia.Skia.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0001</DiagnosticId>
|
||||
<Target>T:Avalonia.Skia.ISkiaGpuRenderTarget2</Target>
|
||||
<Left>baseline/Avalonia.Skia/lib/net8.0/Avalonia.Skia.dll</Left>
|
||||
<Right>current/Avalonia.Skia/lib/net8.0/Avalonia.Skia.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0001</DiagnosticId>
|
||||
<Target>T:Avalonia.Skia.ISkiaGpuWithPlatformGraphicsContext</Target>
|
||||
<Left>baseline/Avalonia.Skia/lib/net8.0/Avalonia.Skia.dll</Left>
|
||||
<Right>current/Avalonia.Skia/lib/net8.0/Avalonia.Skia.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0002</DiagnosticId>
|
||||
<Target>M:Avalonia.Skia.ISkiaGpuRenderTarget.BeginRenderingSession</Target>
|
||||
<Left>baseline/Avalonia.Skia/lib/net10.0/Avalonia.Skia.dll</Left>
|
||||
<Right>current/Avalonia.Skia/lib/net10.0/Avalonia.Skia.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0002</DiagnosticId>
|
||||
<Target>M:Avalonia.Skia.ISkiaGpuRenderTarget.BeginRenderingSession</Target>
|
||||
<Left>baseline/Avalonia.Skia/lib/net8.0/Avalonia.Skia.dll</Left>
|
||||
<Right>current/Avalonia.Skia/lib/net8.0/Avalonia.Skia.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0006</DiagnosticId>
|
||||
<Target>M:Avalonia.Skia.ISkiaGpu.TryGetGrContext</Target>
|
||||
<Left>baseline/Avalonia.Skia/lib/net10.0/Avalonia.Skia.dll</Left>
|
||||
<Right>current/Avalonia.Skia/lib/net10.0/Avalonia.Skia.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0006</DiagnosticId>
|
||||
<Target>M:Avalonia.Skia.ISkiaGpuRenderTarget.BeginRenderingSession(System.Nullable{Avalonia.PixelSize})</Target>
|
||||
<Left>baseline/Avalonia.Skia/lib/net10.0/Avalonia.Skia.dll</Left>
|
||||
<Right>current/Avalonia.Skia/lib/net10.0/Avalonia.Skia.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0006</DiagnosticId>
|
||||
<Target>P:Avalonia.Skia.ISkiaGpu.PlatformGraphicsContext</Target>
|
||||
<Left>baseline/Avalonia.Skia/lib/net10.0/Avalonia.Skia.dll</Left>
|
||||
<Right>current/Avalonia.Skia/lib/net10.0/Avalonia.Skia.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0006</DiagnosticId>
|
||||
<Target>M:Avalonia.Skia.ISkiaGpu.TryGetGrContext</Target>
|
||||
<Left>baseline/Avalonia.Skia/lib/net8.0/Avalonia.Skia.dll</Left>
|
||||
<Right>current/Avalonia.Skia/lib/net8.0/Avalonia.Skia.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0006</DiagnosticId>
|
||||
<Target>M:Avalonia.Skia.ISkiaGpuRenderTarget.BeginRenderingSession(System.Nullable{Avalonia.PixelSize})</Target>
|
||||
<Left>baseline/Avalonia.Skia/lib/net8.0/Avalonia.Skia.dll</Left>
|
||||
<Right>current/Avalonia.Skia/lib/net8.0/Avalonia.Skia.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0006</DiagnosticId>
|
||||
<Target>P:Avalonia.Skia.ISkiaGpu.PlatformGraphicsContext</Target>
|
||||
<Left>baseline/Avalonia.Skia/lib/net8.0/Avalonia.Skia.dll</Left>
|
||||
<Right>current/Avalonia.Skia/lib/net8.0/Avalonia.Skia.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0008</DiagnosticId>
|
||||
<Target>T:Avalonia.Skia.ISkiaGpu</Target>
|
||||
|
||||
@@ -79,6 +79,18 @@
|
||||
<Left>baseline/Avalonia/lib/net10.0/Avalonia.Base.dll</Left>
|
||||
<Right>current/Avalonia/lib/net10.0/Avalonia.Base.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0001</DiagnosticId>
|
||||
<Target>T:Avalonia.Platform.IRenderTarget2</Target>
|
||||
<Left>baseline/Avalonia/lib/net10.0/Avalonia.Base.dll</Left>
|
||||
<Right>current/Avalonia/lib/net10.0/Avalonia.Base.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0001</DiagnosticId>
|
||||
<Target>T:Avalonia.Platform.IRenderTargetWithProperties</Target>
|
||||
<Left>baseline/Avalonia/lib/net10.0/Avalonia.Base.dll</Left>
|
||||
<Right>current/Avalonia/lib/net10.0/Avalonia.Base.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0001</DiagnosticId>
|
||||
<Target>T:Avalonia.Platform.OptionalFeatureProviderExtensions</Target>
|
||||
@@ -199,6 +211,18 @@
|
||||
<Left>baseline/Avalonia/lib/net10.0/Avalonia.Markup.Xaml.dll</Left>
|
||||
<Right>current/Avalonia/lib/net10.0/Avalonia.Markup.Xaml.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0001</DiagnosticId>
|
||||
<Target>T:Avalonia.OpenGL.Surfaces.IGlPlatformSurfaceRenderTarget2</Target>
|
||||
<Left>baseline/Avalonia/lib/net10.0/Avalonia.OpenGL.dll</Left>
|
||||
<Right>current/Avalonia/lib/net10.0/Avalonia.OpenGL.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0001</DiagnosticId>
|
||||
<Target>T:Avalonia.OpenGL.Surfaces.IGlPlatformSurfaceRenderTargetWithCorruptionInfo</Target>
|
||||
<Left>baseline/Avalonia/lib/net10.0/Avalonia.OpenGL.dll</Left>
|
||||
<Right>current/Avalonia/lib/net10.0/Avalonia.OpenGL.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0001</DiagnosticId>
|
||||
<Target>T:Avalonia.Media.Fonts.FontFamilyLoader</Target>
|
||||
@@ -283,6 +307,18 @@
|
||||
<Left>baseline/Avalonia/lib/net8.0/Avalonia.Base.dll</Left>
|
||||
<Right>current/Avalonia/lib/net8.0/Avalonia.Base.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0001</DiagnosticId>
|
||||
<Target>T:Avalonia.Platform.IRenderTarget2</Target>
|
||||
<Left>baseline/Avalonia/lib/net8.0/Avalonia.Base.dll</Left>
|
||||
<Right>current/Avalonia/lib/net8.0/Avalonia.Base.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0001</DiagnosticId>
|
||||
<Target>T:Avalonia.Platform.IRenderTargetWithProperties</Target>
|
||||
<Left>baseline/Avalonia/lib/net8.0/Avalonia.Base.dll</Left>
|
||||
<Right>current/Avalonia/lib/net8.0/Avalonia.Base.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0001</DiagnosticId>
|
||||
<Target>T:Avalonia.Platform.OptionalFeatureProviderExtensions</Target>
|
||||
@@ -403,6 +439,18 @@
|
||||
<Left>baseline/Avalonia/lib/net8.0/Avalonia.Markup.Xaml.dll</Left>
|
||||
<Right>current/Avalonia/lib/net8.0/Avalonia.Markup.Xaml.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0001</DiagnosticId>
|
||||
<Target>T:Avalonia.OpenGL.Surfaces.IGlPlatformSurfaceRenderTarget2</Target>
|
||||
<Left>baseline/Avalonia/lib/net8.0/Avalonia.OpenGL.dll</Left>
|
||||
<Right>current/Avalonia/lib/net8.0/Avalonia.OpenGL.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0001</DiagnosticId>
|
||||
<Target>T:Avalonia.OpenGL.Surfaces.IGlPlatformSurfaceRenderTargetWithCorruptionInfo</Target>
|
||||
<Left>baseline/Avalonia/lib/net8.0/Avalonia.OpenGL.dll</Left>
|
||||
<Right>current/Avalonia/lib/net8.0/Avalonia.OpenGL.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0001</DiagnosticId>
|
||||
<Target>T:Avalonia.Media.Fonts.FontFamilyLoader</Target>
|
||||
@@ -1261,6 +1309,24 @@
|
||||
<Left>baseline/Avalonia/lib/net10.0/Avalonia.Markup.Xaml.dll</Left>
|
||||
<Right>current/Avalonia/lib/net10.0/Avalonia.Markup.Xaml.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0002</DiagnosticId>
|
||||
<Target>M:Avalonia.OpenGL.Egl.EglPlatformSurfaceRenderTargetBase.BeginDraw</Target>
|
||||
<Left>baseline/Avalonia/lib/net10.0/Avalonia.OpenGL.dll</Left>
|
||||
<Right>current/Avalonia/lib/net10.0/Avalonia.OpenGL.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0002</DiagnosticId>
|
||||
<Target>M:Avalonia.OpenGL.Egl.EglPlatformSurfaceRenderTargetBase.BeginDrawCore</Target>
|
||||
<Left>baseline/Avalonia/lib/net10.0/Avalonia.OpenGL.dll</Left>
|
||||
<Right>current/Avalonia/lib/net10.0/Avalonia.OpenGL.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0002</DiagnosticId>
|
||||
<Target>M:Avalonia.OpenGL.Surfaces.IGlPlatformSurfaceRenderTarget.BeginDraw</Target>
|
||||
<Left>baseline/Avalonia/lib/net10.0/Avalonia.OpenGL.dll</Left>
|
||||
<Right>current/Avalonia/lib/net10.0/Avalonia.OpenGL.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0002</DiagnosticId>
|
||||
<Target>F:Avalonia.Media.Fonts.FontCollectionBase._glyphTypefaceCache</Target>
|
||||
@@ -2149,6 +2215,24 @@
|
||||
<Left>baseline/Avalonia/lib/net8.0/Avalonia.Markup.Xaml.dll</Left>
|
||||
<Right>current/Avalonia/lib/net8.0/Avalonia.Markup.Xaml.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0002</DiagnosticId>
|
||||
<Target>M:Avalonia.OpenGL.Egl.EglPlatformSurfaceRenderTargetBase.BeginDraw</Target>
|
||||
<Left>baseline/Avalonia/lib/net8.0/Avalonia.OpenGL.dll</Left>
|
||||
<Right>current/Avalonia/lib/net8.0/Avalonia.OpenGL.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0002</DiagnosticId>
|
||||
<Target>M:Avalonia.OpenGL.Egl.EglPlatformSurfaceRenderTargetBase.BeginDrawCore</Target>
|
||||
<Left>baseline/Avalonia/lib/net8.0/Avalonia.OpenGL.dll</Left>
|
||||
<Right>current/Avalonia/lib/net8.0/Avalonia.OpenGL.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0002</DiagnosticId>
|
||||
<Target>M:Avalonia.OpenGL.Surfaces.IGlPlatformSurfaceRenderTarget.BeginDraw</Target>
|
||||
<Left>baseline/Avalonia/lib/net8.0/Avalonia.OpenGL.dll</Left>
|
||||
<Right>current/Avalonia/lib/net8.0/Avalonia.OpenGL.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0002</DiagnosticId>
|
||||
<Target>F:Avalonia.Media.Fonts.FontCollectionBase._glyphTypefaceCache</Target>
|
||||
@@ -2191,6 +2275,18 @@
|
||||
<Left>baseline/netstandard2.0/Avalonia.Base.dll</Left>
|
||||
<Right>target/netstandard2.0/Avalonia.Base.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0005</DiagnosticId>
|
||||
<Target>M:Avalonia.OpenGL.Egl.EglPlatformSurfaceRenderTargetBase.BeginDrawCore(System.Nullable{Avalonia.PixelSize})</Target>
|
||||
<Left>baseline/Avalonia/lib/net10.0/Avalonia.OpenGL.dll</Left>
|
||||
<Right>current/Avalonia/lib/net10.0/Avalonia.OpenGL.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0005</DiagnosticId>
|
||||
<Target>M:Avalonia.OpenGL.Egl.EglPlatformSurfaceRenderTargetBase.BeginDrawCore(System.Nullable{Avalonia.PixelSize})</Target>
|
||||
<Left>baseline/Avalonia/lib/net8.0/Avalonia.OpenGL.dll</Left>
|
||||
<Right>current/Avalonia/lib/net8.0/Avalonia.OpenGL.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0006</DiagnosticId>
|
||||
<Target>M:Avalonia.Input.IKeyboardNavigationHandler.Move(Avalonia.Input.IInputElement,Avalonia.Input.NavigationDirection,Avalonia.Input.KeyModifiers,System.Nullable{Avalonia.Input.KeyDeviceType})</Target>
|
||||
@@ -2251,6 +2347,12 @@
|
||||
<Left>baseline/Avalonia/lib/net10.0/Avalonia.Base.dll</Left>
|
||||
<Right>current/Avalonia/lib/net10.0/Avalonia.Base.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0006</DiagnosticId>
|
||||
<Target>M:Avalonia.Platform.IRenderTarget.CreateDrawingContext(Avalonia.PixelSize,Avalonia.Platform.RenderTargetDrawingContextProperties@)</Target>
|
||||
<Left>baseline/Avalonia/lib/net10.0/Avalonia.Base.dll</Left>
|
||||
<Right>current/Avalonia/lib/net10.0/Avalonia.Base.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0006</DiagnosticId>
|
||||
<Target>P:Avalonia.Platform.ILockedFramebuffer.AlphaFormat</Target>
|
||||
@@ -2269,6 +2371,24 @@
|
||||
<Left>baseline/Avalonia/lib/net10.0/Avalonia.Base.dll</Left>
|
||||
<Right>current/Avalonia/lib/net10.0/Avalonia.Base.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0006</DiagnosticId>
|
||||
<Target>P:Avalonia.Platform.IRenderTarget.Properties</Target>
|
||||
<Left>baseline/Avalonia/lib/net10.0/Avalonia.Base.dll</Left>
|
||||
<Right>current/Avalonia/lib/net10.0/Avalonia.Base.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0006</DiagnosticId>
|
||||
<Target>M:Avalonia.OpenGL.Surfaces.IGlPlatformSurfaceRenderTarget.BeginDraw(System.Nullable{Avalonia.PixelSize})</Target>
|
||||
<Left>baseline/Avalonia/lib/net10.0/Avalonia.OpenGL.dll</Left>
|
||||
<Right>current/Avalonia/lib/net10.0/Avalonia.OpenGL.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0006</DiagnosticId>
|
||||
<Target>P:Avalonia.OpenGL.Surfaces.IGlPlatformSurfaceRenderTarget.IsCorrupted</Target>
|
||||
<Left>baseline/Avalonia/lib/net10.0/Avalonia.OpenGL.dll</Left>
|
||||
<Right>current/Avalonia/lib/net10.0/Avalonia.OpenGL.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0006</DiagnosticId>
|
||||
<Target>M:Avalonia.Input.Platform.IClipboard.SetDataAsync(Avalonia.Input.IAsyncDataTransfer)</Target>
|
||||
@@ -2419,6 +2539,12 @@
|
||||
<Left>baseline/Avalonia/lib/net8.0/Avalonia.Base.dll</Left>
|
||||
<Right>current/Avalonia/lib/net8.0/Avalonia.Base.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0006</DiagnosticId>
|
||||
<Target>M:Avalonia.Platform.IRenderTarget.CreateDrawingContext(Avalonia.PixelSize,Avalonia.Platform.RenderTargetDrawingContextProperties@)</Target>
|
||||
<Left>baseline/Avalonia/lib/net8.0/Avalonia.Base.dll</Left>
|
||||
<Right>current/Avalonia/lib/net8.0/Avalonia.Base.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0006</DiagnosticId>
|
||||
<Target>M:Avalonia.Platform.Storage.IStorageProvider.SaveFilePickerWithResultAsync(Avalonia.Platform.Storage.FilePickerSaveOptions)</Target>
|
||||
@@ -2443,6 +2569,12 @@
|
||||
<Left>baseline/Avalonia/lib/net8.0/Avalonia.Base.dll</Left>
|
||||
<Right>current/Avalonia/lib/net8.0/Avalonia.Base.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0006</DiagnosticId>
|
||||
<Target>P:Avalonia.Platform.IRenderTarget.Properties</Target>
|
||||
<Left>baseline/Avalonia/lib/net8.0/Avalonia.Base.dll</Left>
|
||||
<Right>current/Avalonia/lib/net8.0/Avalonia.Base.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0006</DiagnosticId>
|
||||
<Target>M:Avalonia.OpenGL.IGlExternalSemaphore.SignalTimelineSemaphore(Avalonia.OpenGL.IGlExternalImageTexture,System.UInt64)</Target>
|
||||
@@ -2455,12 +2587,24 @@
|
||||
<Left>baseline/Avalonia/lib/net8.0/Avalonia.OpenGL.dll</Left>
|
||||
<Right>current/Avalonia/lib/net8.0/Avalonia.OpenGL.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0006</DiagnosticId>
|
||||
<Target>M:Avalonia.OpenGL.Surfaces.IGlPlatformSurfaceRenderTarget.BeginDraw(System.Nullable{Avalonia.PixelSize})</Target>
|
||||
<Left>baseline/Avalonia/lib/net8.0/Avalonia.OpenGL.dll</Left>
|
||||
<Right>current/Avalonia/lib/net8.0/Avalonia.OpenGL.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0006</DiagnosticId>
|
||||
<Target>P:Avalonia.OpenGL.IGlExternalImageTexture.TextureType</Target>
|
||||
<Left>baseline/Avalonia/lib/net8.0/Avalonia.OpenGL.dll</Left>
|
||||
<Right>current/Avalonia/lib/net8.0/Avalonia.OpenGL.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0006</DiagnosticId>
|
||||
<Target>P:Avalonia.OpenGL.Surfaces.IGlPlatformSurfaceRenderTarget.IsCorrupted</Target>
|
||||
<Left>baseline/Avalonia/lib/net8.0/Avalonia.OpenGL.dll</Left>
|
||||
<Right>current/Avalonia/lib/net8.0/Avalonia.OpenGL.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0006</DiagnosticId>
|
||||
<Target>M:Avalonia.Input.Platform.IClipboard.SetDataAsync(Avalonia.Input.IAsyncDataTransfer)</Target>
|
||||
@@ -2629,6 +2773,12 @@
|
||||
<Left>baseline/Avalonia/lib/net10.0/Avalonia.OpenGL.dll</Left>
|
||||
<Right>current/Avalonia/lib/net10.0/Avalonia.OpenGL.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0008</DiagnosticId>
|
||||
<Target>T:Avalonia.OpenGL.Egl.EglPlatformSurfaceRenderTargetBase</Target>
|
||||
<Left>baseline/Avalonia/lib/net10.0/Avalonia.OpenGL.dll</Left>
|
||||
<Right>current/Avalonia/lib/net10.0/Avalonia.OpenGL.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0008</DiagnosticId>
|
||||
<Target>T:Avalonia.OpenGL.IGlContext</Target>
|
||||
@@ -2743,6 +2893,12 @@
|
||||
<Left>baseline/Avalonia/lib/net8.0/Avalonia.OpenGL.dll</Left>
|
||||
<Right>current/Avalonia/lib/net8.0/Avalonia.OpenGL.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0008</DiagnosticId>
|
||||
<Target>T:Avalonia.OpenGL.Egl.EglPlatformSurfaceRenderTargetBase</Target>
|
||||
<Left>baseline/Avalonia/lib/net8.0/Avalonia.OpenGL.dll</Left>
|
||||
<Right>current/Avalonia/lib/net8.0/Avalonia.OpenGL.dll</Right>
|
||||
</Suppression>
|
||||
<Suppression>
|
||||
<DiagnosticId>CP0008</DiagnosticId>
|
||||
<Target>T:Avalonia.OpenGL.IGlContext</Target>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using Avalonia.Metadata;
|
||||
using Avalonia.Rendering;
|
||||
|
||||
namespace Avalonia.Platform
|
||||
{
|
||||
@@ -13,51 +12,29 @@ namespace Avalonia.Platform
|
||||
[PrivateApi]
|
||||
public interface IRenderTarget : IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates if the render target is no longer usable and needs to be recreated
|
||||
/// </summary>
|
||||
bool IsCorrupted { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the properties of the render target.
|
||||
/// </summary>
|
||||
RenderTargetProperties Properties { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates an <see cref="IDrawingContextImpl"/> for a rendering session.
|
||||
/// </summary>
|
||||
/// <param name="useScaledDrawing">Apply DPI reported by the render target as a hidden transform matrix</param>
|
||||
IDrawingContextImpl CreateDrawingContext(bool useScaledDrawing);
|
||||
|
||||
/// <summary>
|
||||
/// Indicates if the render target is no longer usable and needs to be recreated
|
||||
/// </summary>
|
||||
public bool IsCorrupted { get; }
|
||||
}
|
||||
|
||||
[PrivateApi, Obsolete("Use IRenderTarget2", true)]
|
||||
// TODO12: Remove
|
||||
public interface IRenderTargetWithProperties : IRenderTarget
|
||||
{
|
||||
RenderTargetProperties Properties { get; }
|
||||
}
|
||||
|
||||
[PrivateApi]
|
||||
// TODO12: Merge into IRenderTarget
|
||||
public interface IRenderTarget2 : IRenderTarget
|
||||
{
|
||||
RenderTargetProperties Properties { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates an <see cref="IDrawingContextImpl"/> for a rendering session.
|
||||
/// </summary>
|
||||
/// <param name="expectedPixelSize">The pixel size of the surface</param>
|
||||
/// <param name="properties">Returns various properties about the returned drawing context</param>
|
||||
IDrawingContextImpl CreateDrawingContext(PixelSize expectedPixelSize,
|
||||
IDrawingContextImpl CreateDrawingContext(
|
||||
PixelSize expectedPixelSize,
|
||||
out RenderTargetDrawingContextProperties properties);
|
||||
}
|
||||
|
||||
internal static class RenderTargetExtensions
|
||||
{
|
||||
public static IDrawingContextImpl CreateDrawingContextWithProperties(
|
||||
this IRenderTarget renderTarget,
|
||||
PixelSize expectedPixelSize,
|
||||
out RenderTargetDrawingContextProperties properties)
|
||||
{
|
||||
if (renderTarget is IRenderTarget2 target)
|
||||
return target.CreateDrawingContext(expectedPixelSize, out properties);
|
||||
properties = default;
|
||||
return renderTarget.CreateDrawingContext(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,15 +161,12 @@ namespace Avalonia.Rendering.Composition.Server
|
||||
if (!_redrawRequested)
|
||||
return;
|
||||
|
||||
var renderTargetWithProperties = _renderTarget as IRenderTarget2;
|
||||
|
||||
|
||||
var needLayer = _overlays.RequireLayer // Check if we don't need overlays
|
||||
// Check if render target can be rendered to directly and preserves the previous frame
|
||||
|| !(renderTargetWithProperties?.Properties.RetainsPreviousFrameContents == true
|
||||
&& renderTargetWithProperties?.Properties.IsSuitableForDirectRendering == true);
|
||||
|| !(_renderTarget.Properties.RetainsPreviousFrameContents
|
||||
&& _renderTarget.Properties.IsSuitableForDirectRendering);
|
||||
|
||||
using (var renderTargetContext = _renderTarget.CreateDrawingContextWithProperties(
|
||||
using (var renderTargetContext = _renderTarget.CreateDrawingContext(
|
||||
this.PixelSize, out var properties))
|
||||
using (var renderTiming = Diagnostic.BeginCompositorRenderPass())
|
||||
{
|
||||
|
||||
@@ -173,8 +173,11 @@ namespace Avalonia.Native
|
||||
_context = context;
|
||||
}
|
||||
|
||||
public IGlPlatformSurfaceRenderingSession BeginDraw()
|
||||
public bool IsCorrupted => false;
|
||||
|
||||
public IGlPlatformSurfaceRenderingSession BeginDraw(PixelSize? expectedPixelSize)
|
||||
{
|
||||
// TODO: use expectedPixelSize
|
||||
ObjectDisposedException.ThrowIf(_target is null, this);
|
||||
return new GlPlatformSurfaceRenderingSession(_context, _target.BeginDrawing());
|
||||
}
|
||||
|
||||
@@ -54,8 +54,9 @@ namespace Avalonia.OpenGL.Egl
|
||||
|
||||
public override void Dispose() => _glSurface?.Dispose();
|
||||
|
||||
public override IGlPlatformSurfaceRenderingSession BeginDrawCore()
|
||||
public override IGlPlatformSurfaceRenderingSession BeginDrawCore(PixelSize? expectedPixelSize)
|
||||
{
|
||||
// TODO: use expectedPixelSize
|
||||
if (_info.Size != _currentSize
|
||||
|| _handle != _info.Handle
|
||||
|| _glSurface == null)
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Avalonia.OpenGL.Egl
|
||||
public abstract IGlPlatformSurfaceRenderTarget CreateGlRenderTarget(IGlContext context);
|
||||
}
|
||||
|
||||
public abstract class EglPlatformSurfaceRenderTargetBase : IGlPlatformSurfaceRenderTargetWithCorruptionInfo
|
||||
public abstract class EglPlatformSurfaceRenderTargetBase : IGlPlatformSurfaceRenderTarget
|
||||
{
|
||||
protected EglContext Context { get; }
|
||||
|
||||
@@ -22,17 +22,17 @@ namespace Avalonia.OpenGL.Egl
|
||||
|
||||
}
|
||||
|
||||
public IGlPlatformSurfaceRenderingSession BeginDraw()
|
||||
public IGlPlatformSurfaceRenderingSession BeginDraw(PixelSize? expectedPixelSize)
|
||||
{
|
||||
if (Context.IsLost)
|
||||
throw new RenderTargetCorruptedException();
|
||||
|
||||
return BeginDrawCore();
|
||||
return BeginDrawCore(expectedPixelSize);
|
||||
}
|
||||
|
||||
private protected virtual bool SkipWaits => false;
|
||||
|
||||
public abstract IGlPlatformSurfaceRenderingSession BeginDrawCore();
|
||||
public abstract IGlPlatformSurfaceRenderingSession BeginDrawCore(PixelSize? expectedPixelSize);
|
||||
|
||||
protected IGlPlatformSurfaceRenderingSession BeginDraw(EglSurface surface,
|
||||
PixelSize size, double scaling, Action? onFinish = null, bool isYFlipped = false)
|
||||
|
||||
@@ -1,22 +1,11 @@
|
||||
using System;
|
||||
using Avalonia.Metadata;
|
||||
|
||||
namespace Avalonia.OpenGL.Surfaces
|
||||
{
|
||||
public interface IGlPlatformSurfaceRenderTarget : IDisposable
|
||||
{
|
||||
IGlPlatformSurfaceRenderingSession BeginDraw();
|
||||
}
|
||||
|
||||
public interface IGlPlatformSurfaceRenderTargetWithCorruptionInfo : IGlPlatformSurfaceRenderTarget
|
||||
{
|
||||
bool IsCorrupted { get; }
|
||||
}
|
||||
|
||||
[PrivateApi]
|
||||
public interface IGlPlatformSurfaceRenderTarget2 : IGlPlatformSurfaceRenderTargetWithCorruptionInfo
|
||||
{
|
||||
IGlPlatformSurfaceRenderingSession BeginDraw(PixelSize expectedPixelSize);
|
||||
IGlPlatformSurfaceRenderingSession BeginDraw(PixelSize? expectedPixelSize);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Avalonia.X11.Glx
|
||||
return new RenderTarget((GlxContext)context, _info);
|
||||
}
|
||||
|
||||
private class RenderTarget : IGlPlatformSurfaceRenderTarget2
|
||||
private class RenderTarget : IGlPlatformSurfaceRenderTarget
|
||||
{
|
||||
private readonly GlxContext _context;
|
||||
private readonly EglGlPlatformSurface.IEglWindowGlPlatformSurfaceInfo _info;
|
||||
@@ -39,9 +39,8 @@ namespace Avalonia.X11.Glx
|
||||
}
|
||||
|
||||
public bool IsCorrupted => false;
|
||||
public IGlPlatformSurfaceRenderingSession BeginDraw(PixelSize size) => BeginDrawCore(size);
|
||||
public IGlPlatformSurfaceRenderingSession BeginDraw() => BeginDrawCore(null);
|
||||
public IGlPlatformSurfaceRenderingSession BeginDrawCore(PixelSize? expectedSize)
|
||||
|
||||
public IGlPlatformSurfaceRenderingSession BeginDraw(PixelSize? expectedSize)
|
||||
{
|
||||
var size = expectedSize ?? _info.Size;
|
||||
if (expectedSize.HasValue)
|
||||
|
||||
@@ -66,13 +66,16 @@ partial class BrowserWebGlRenderTarget : BrowserRenderTarget, IGlPlatformSurface
|
||||
_target = target;
|
||||
}
|
||||
|
||||
public bool IsCorrupted => false;
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// No-op
|
||||
}
|
||||
|
||||
public IGlPlatformSurfaceRenderingSession BeginDraw()
|
||||
public IGlPlatformSurfaceRenderingSession BeginDraw(PixelSize? expectedPixelSize)
|
||||
{
|
||||
// TODO: use expectedPixelSize
|
||||
var s = _target._sizeGetter();
|
||||
_target.UpdateSize(s.Size);
|
||||
var restoreContext = _target.GlContext.EnsureCurrent();
|
||||
|
||||
@@ -400,11 +400,20 @@ namespace Avalonia.Headless
|
||||
|
||||
}
|
||||
|
||||
public IDrawingContextImpl CreateDrawingContext(bool _)
|
||||
public IDrawingContextImpl CreateDrawingContext(bool useScaledDrawing)
|
||||
{
|
||||
return new HeadlessDrawingContextStub();
|
||||
}
|
||||
|
||||
public IDrawingContextImpl CreateDrawingContext(PixelSize expectedPixelSize,
|
||||
out RenderTargetDrawingContextProperties properties)
|
||||
{
|
||||
properties = default;
|
||||
return new HeadlessDrawingContextStub();
|
||||
}
|
||||
|
||||
public RenderTargetProperties Properties => default;
|
||||
|
||||
public bool IsCorrupted => false;
|
||||
|
||||
public void Blit(IDrawingContextImpl context)
|
||||
@@ -582,16 +591,25 @@ namespace Avalonia.Headless
|
||||
|
||||
private class HeadlessRenderTarget : IRenderTarget
|
||||
{
|
||||
public RenderTargetProperties Properties => default;
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public IDrawingContextImpl CreateDrawingContext(bool _)
|
||||
public IDrawingContextImpl CreateDrawingContext(bool useScaledDrawing)
|
||||
{
|
||||
return new HeadlessDrawingContextStub();
|
||||
}
|
||||
|
||||
public IDrawingContextImpl CreateDrawingContext(PixelSize expectedPixelSize,
|
||||
out RenderTargetDrawingContextProperties properties)
|
||||
{
|
||||
properties = default;
|
||||
return new HeadlessDrawingContextStub();
|
||||
}
|
||||
|
||||
public bool IsCorrupted => false;
|
||||
}
|
||||
|
||||
|
||||
@@ -377,7 +377,7 @@ namespace Avalonia.LinuxFramebuffer.Output
|
||||
{
|
||||
//Go through two cycles of buffer swapping (there are render artifacts otherwise)
|
||||
for (var c = 0; c < 2; c++)
|
||||
using (CreateGlRenderTarget().BeginDraw())
|
||||
using (CreateGlRenderTarget().BeginDraw(PixelSize))
|
||||
{
|
||||
_deferredContext.GlInterface.ClearColor(initialBufferSwappingColorR, initialBufferSwappingColorG,
|
||||
initialBufferSwappingColorB, initialBufferSwappingColorA);
|
||||
@@ -406,6 +406,9 @@ namespace Avalonia.LinuxFramebuffer.Output
|
||||
{
|
||||
_parent = parent;
|
||||
}
|
||||
|
||||
public bool IsCorrupted => false;
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// We are wrapping GBM buffer chain associated with CRTC, and don't free it on a whim
|
||||
@@ -508,7 +511,7 @@ namespace Avalonia.LinuxFramebuffer.Output
|
||||
public bool IsYFlipped => false;
|
||||
}
|
||||
|
||||
public IGlPlatformSurfaceRenderingSession BeginDraw()
|
||||
public IGlPlatformSurfaceRenderingSession BeginDraw(PixelSize? expectedPixelSize)
|
||||
{
|
||||
var clearContext = _parent._deferredContext.MakeCurrent(_parent._eglSurface);
|
||||
var gl = _parent._deferredContext.GlInterface;
|
||||
|
||||
@@ -170,8 +170,7 @@ namespace Avalonia.Skia
|
||||
public ISkiaSharpPlatformGraphicsApiLease? TryLeasePlatformGraphicsApi()
|
||||
{
|
||||
CheckLease();
|
||||
if (_context._gpu is ISkiaGpuWithPlatformGraphicsContext gpu &&
|
||||
gpu.PlatformGraphicsContext is { } context)
|
||||
if (_context._gpu?.PlatformGraphicsContext is { } context)
|
||||
return new PlatformApiLease(this, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Avalonia.Skia
|
||||
/// <summary>
|
||||
/// Skia render target that renders to a framebuffer surface. No gpu acceleration available.
|
||||
/// </summary>
|
||||
internal class FramebufferRenderTarget : IRenderTarget2
|
||||
internal class FramebufferRenderTarget : IRenderTarget
|
||||
{
|
||||
private SKImageInfo _currentImageInfo;
|
||||
private IntPtr _currentFramebufferAddress;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Avalonia.Metadata;
|
||||
using Avalonia.Platform;
|
||||
using SkiaSharp;
|
||||
|
||||
@@ -13,6 +12,11 @@ namespace Avalonia.Skia
|
||||
/// </summary>
|
||||
public interface ISkiaGpu : IPlatformGraphicsContext
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the platform graphics context.
|
||||
/// </summary>
|
||||
IPlatformGraphicsContext? PlatformGraphicsContext { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to create custom render target from given surfaces.
|
||||
/// </summary>
|
||||
@@ -26,13 +30,11 @@ namespace Avalonia.Skia
|
||||
/// <param name="size">size in pixels.</param>
|
||||
/// <param name="session">An optional custom render session.</param>
|
||||
ISkiaSurface? TryCreateSurface(PixelSize size, ISkiaGpuRenderSession? session);
|
||||
}
|
||||
|
||||
//TODO12: Merge into ISkiaGpu
|
||||
[Unstable]
|
||||
public interface ISkiaGpuWithPlatformGraphicsContext : ISkiaGpu
|
||||
{
|
||||
IPlatformGraphicsContext? PlatformGraphicsContext { get; }
|
||||
/// <summary>
|
||||
/// Tries to get a <see cref="GRContext"/>.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="GRContext"/>.</returns>
|
||||
IScopedResource<GRContext>? TryGetGrContext();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using System;
|
||||
using Avalonia.Metadata;
|
||||
using SkiaSharp;
|
||||
|
||||
namespace Avalonia.Skia
|
||||
{
|
||||
@@ -12,16 +10,10 @@ namespace Avalonia.Skia
|
||||
/// <summary>
|
||||
/// Start rendering to this render target.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
ISkiaGpuRenderSession BeginRenderingSession();
|
||||
/// <param name="expectedPixelSize">The expected size.</param>
|
||||
/// <returns>A render session instance.</returns>
|
||||
ISkiaGpuRenderSession BeginRenderingSession(PixelSize? expectedPixelSize);
|
||||
|
||||
bool IsCorrupted { get; }
|
||||
}
|
||||
|
||||
[PrivateApi]
|
||||
//TODO12: Merge with ISkiaGpuRenderTarget
|
||||
public interface ISkiaGpuRenderTarget2 : ISkiaGpuRenderTarget
|
||||
{
|
||||
ISkiaGpuRenderSession BeginRenderingSession(PixelSize pixelSize);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ using SkiaSharp;
|
||||
|
||||
namespace Avalonia.Skia.Metal;
|
||||
|
||||
internal class SkiaMetalGpu : ISkiaGpu, ISkiaGpuWithPlatformGraphicsContext
|
||||
internal class SkiaMetalGpu : ISkiaGpu
|
||||
{
|
||||
private GRContext? _context;
|
||||
private readonly IMetalDevice _device;
|
||||
@@ -80,8 +80,9 @@ internal class SkiaMetalGpu : ISkiaGpu, ISkiaGpuWithPlatformGraphicsContext
|
||||
_target = null;
|
||||
}
|
||||
|
||||
public ISkiaGpuRenderSession BeginRenderingSession()
|
||||
public ISkiaGpuRenderSession BeginRenderingSession(PixelSize? expectedPixelSize)
|
||||
{
|
||||
// TODO: use expectedPixelSize
|
||||
var session = (_target ?? throw new ObjectDisposedException(nameof(SkiaMetalRenderTarget))).BeginRendering();
|
||||
var backendTarget = new GRBackendRenderTarget(session.Size.Width, session.Size.Height,
|
||||
new GRMtlTextureInfo(session.Texture));
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
using System;
|
||||
using Avalonia.Reactive;
|
||||
using Avalonia.OpenGL;
|
||||
using Avalonia.OpenGL.Surfaces;
|
||||
using Avalonia.Platform;
|
||||
using Avalonia.Rendering;
|
||||
using SkiaSharp;
|
||||
using static Avalonia.OpenGL.GlConsts;
|
||||
|
||||
namespace Avalonia.Skia
|
||||
{
|
||||
internal class GlRenderTarget : ISkiaGpuRenderTarget2
|
||||
internal class GlRenderTarget : ISkiaGpuRenderTarget
|
||||
{
|
||||
private readonly GRContext _grContext;
|
||||
private IGlPlatformSurfaceRenderTarget _surface;
|
||||
@@ -23,7 +20,7 @@ namespace Avalonia.Skia
|
||||
|
||||
public void Dispose() => _surface.Dispose();
|
||||
|
||||
public bool IsCorrupted => (_surface as IGlPlatformSurfaceRenderTargetWithCorruptionInfo)?.IsCorrupted == true;
|
||||
public bool IsCorrupted => _surface.IsCorrupted;
|
||||
|
||||
class GlGpuSession : ISkiaGpuRenderSession
|
||||
{
|
||||
@@ -59,15 +56,9 @@ namespace Avalonia.Skia
|
||||
public double ScaleFactor => _glSession.Scaling;
|
||||
}
|
||||
|
||||
public ISkiaGpuRenderSession BeginRenderingSession(PixelSize size) => BeginRenderingSessionCore(size);
|
||||
public ISkiaGpuRenderSession BeginRenderingSession() => BeginRenderingSessionCore(null);
|
||||
|
||||
ISkiaGpuRenderSession BeginRenderingSessionCore(PixelSize? expectedSize)
|
||||
public ISkiaGpuRenderSession BeginRenderingSession(PixelSize? expectedPixelSize)
|
||||
{
|
||||
var glSession =
|
||||
expectedSize != null && _surface is IGlPlatformSurfaceRenderTarget2 surface2
|
||||
? surface2.BeginDraw(expectedSize.Value)
|
||||
: _surface.BeginDraw();
|
||||
var glSession = _surface.BeginDraw(expectedPixelSize);
|
||||
|
||||
bool success = false;
|
||||
try
|
||||
|
||||
@@ -10,8 +10,7 @@ using static Avalonia.OpenGL.GlConsts;
|
||||
|
||||
namespace Avalonia.Skia
|
||||
{
|
||||
internal class GlSkiaGpu : ISkiaGpu, IOpenGlTextureSharingRenderInterfaceContextFeature,
|
||||
ISkiaGpuWithPlatformGraphicsContext
|
||||
internal class GlSkiaGpu : ISkiaGpu, IOpenGlTextureSharingRenderInterfaceContextFeature
|
||||
{
|
||||
private readonly GRContext _grContext;
|
||||
private readonly IGlContext _glContext;
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Avalonia.Skia
|
||||
/// <summary>
|
||||
/// Adapts <see cref="ISkiaGpuRenderTarget"/> to be used within our rendering pipeline.
|
||||
/// </summary>
|
||||
internal class SkiaGpuRenderTarget : IRenderTarget2
|
||||
internal class SkiaGpuRenderTarget : IRenderTarget
|
||||
{
|
||||
private readonly ISkiaGpu _skiaGpu;
|
||||
private readonly ISkiaGpuRenderTarget _renderTarget;
|
||||
@@ -34,10 +34,7 @@ namespace Avalonia.Skia
|
||||
out RenderTargetDrawingContextProperties properties)
|
||||
{
|
||||
properties = default;
|
||||
var session =
|
||||
expectedPixelSize.HasValue && _renderTarget is ISkiaGpuRenderTarget2 target2
|
||||
? target2.BeginRenderingSession(expectedPixelSize.Value)
|
||||
: _renderTarget.BeginRenderingSession();
|
||||
var session = _renderTarget.BeginRenderingSession(expectedPixelSize);
|
||||
|
||||
var nfo = new DrawingContextImpl.CreateInfo
|
||||
{
|
||||
|
||||
@@ -2,12 +2,11 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using Avalonia.Vulkan;
|
||||
using Avalonia.Platform;
|
||||
using Avalonia.Rendering;
|
||||
using SkiaSharp;
|
||||
|
||||
namespace Avalonia.Skia.Vulkan;
|
||||
|
||||
internal class VulkanSkiaGpu : ISkiaGpuWithPlatformGraphicsContext
|
||||
internal class VulkanSkiaGpu : ISkiaGpu
|
||||
{
|
||||
private readonly VulkanSkiaExternalObjectsFeature? _externalObjects;
|
||||
public IVulkanPlatformGraphicsContext Vulkan { get; private set; }
|
||||
|
||||
@@ -21,8 +21,9 @@ class VulkanSkiaRenderTarget : ISkiaGpuRenderTarget
|
||||
_target.Dispose();
|
||||
}
|
||||
|
||||
public ISkiaGpuRenderSession BeginRenderingSession()
|
||||
public ISkiaGpuRenderSession BeginRenderingSession(PixelSize? expectedPixelSize)
|
||||
{
|
||||
// TODO: use expectedPixelSize
|
||||
var session = _target.BeginDraw();
|
||||
bool success = false;
|
||||
try
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using System.IO;
|
||||
using Avalonia.Controls.Platform.Surfaces;
|
||||
using Avalonia.Media.Imaging;
|
||||
using Avalonia.Platform;
|
||||
using SkiaSharp;
|
||||
|
||||
@@ -19,9 +17,18 @@ internal class RenderTargetBitmapImpl : WriteableBitmapImpl,
|
||||
_renderTarget = new FramebufferRenderTarget(this);
|
||||
}
|
||||
|
||||
public RenderTargetProperties Properties => default;
|
||||
|
||||
IDrawingContextImpl IRenderTarget.CreateDrawingContext(bool useScaledDrawing) =>
|
||||
_renderTarget.CreateDrawingContext(useScaledDrawing);
|
||||
|
||||
IDrawingContextImpl IRenderTarget.CreateDrawingContext(PixelSize expectedPixelSize,
|
||||
out RenderTargetDrawingContextProperties properties)
|
||||
{
|
||||
properties = default;
|
||||
return _renderTarget.CreateDrawingContext(false);
|
||||
}
|
||||
|
||||
public bool IsCorrupted => false;
|
||||
|
||||
public override void Dispose()
|
||||
|
||||
@@ -5,7 +5,6 @@ using System.Linq;
|
||||
using Avalonia.Controls.Platform.Surfaces;
|
||||
using Avalonia.OpenGL;
|
||||
using Avalonia.Platform;
|
||||
using SkiaSharp;
|
||||
|
||||
namespace Avalonia.Skia;
|
||||
|
||||
@@ -29,7 +28,7 @@ internal class SkiaContext : IPlatformRenderInterfaceContext
|
||||
// TODO12: extend ISkiaGpu with PublicFeatures instead
|
||||
TryFeature<IOpenGlTextureSharingRenderInterfaceContextFeature>();
|
||||
TryFeature<IExternalObjectsRenderInterfaceContextFeature>();
|
||||
using (var gr = (_gpu as ISkiaGpuWithPlatformGraphicsContext)?.TryGetGrContext())
|
||||
using (var gr = gpu.TryGetGrContext())
|
||||
{
|
||||
var renderTargetSize = gr?.Value.MaxRenderTargetSize;
|
||||
if (renderTargetSize.HasValue)
|
||||
@@ -74,7 +73,7 @@ internal class SkiaContext : IPlatformRenderInterfaceContext
|
||||
public IDrawingContextLayerImpl CreateOffscreenRenderTarget(PixelSize pixelSize, Vector scaling,
|
||||
bool enableTextAntialiasing)
|
||||
{
|
||||
using (var gr = (_gpu as ISkiaGpuWithPlatformGraphicsContext)?.TryGetGrContext())
|
||||
using (var gr = _gpu?.TryGetGrContext())
|
||||
{
|
||||
var createInfo = new SurfaceRenderTarget.CreateInfo
|
||||
{
|
||||
|
||||
@@ -72,6 +72,8 @@ namespace Avalonia.Skia
|
||||
_canvas = canvas;
|
||||
}
|
||||
|
||||
public RenderTargetProperties Properties => default;
|
||||
|
||||
/// <summary>
|
||||
/// Create backing Skia surface.
|
||||
/// </summary>
|
||||
@@ -114,6 +116,13 @@ namespace Avalonia.Skia
|
||||
return new DrawingContextImpl(createInfo, Disposable.Create(() => Version++));
|
||||
}
|
||||
|
||||
public IDrawingContextImpl CreateDrawingContext(PixelSize expectedPixelSize,
|
||||
out RenderTargetDrawingContextProperties properties)
|
||||
{
|
||||
properties = default;
|
||||
return CreateDrawingContext(false);
|
||||
}
|
||||
|
||||
public bool IsCorrupted => _gpu?.IsLost == true;
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -76,8 +76,9 @@ namespace Avalonia.Win32.DirectX
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override IGlPlatformSurfaceRenderingSession BeginDrawCore()
|
||||
public override IGlPlatformSurfaceRenderingSession BeginDrawCore(PixelSize? expectedPixelSize)
|
||||
{
|
||||
// TODO: use expectedPixelSize
|
||||
if (_swapChain is null)
|
||||
{
|
||||
throw new InvalidOperationException("No chain to draw on");
|
||||
|
||||
@@ -27,8 +27,9 @@ internal class AngleD3DTextureFeature : IGlPlatformSurfaceRenderTargetFactory
|
||||
_target = target;
|
||||
}
|
||||
|
||||
public override IGlPlatformSurfaceRenderingSession BeginDrawCore()
|
||||
public override IGlPlatformSurfaceRenderingSession BeginDrawCore(PixelSize? expectedPixelSize)
|
||||
{
|
||||
// TODO: use expectedPixelSize
|
||||
var success = false;
|
||||
var contextLock = Context.EnsureCurrent();
|
||||
IDirect3D11TextureRenderTargetRenderSession? session = null;
|
||||
|
||||
@@ -28,6 +28,7 @@ namespace Avalonia.Win32.OpenGl
|
||||
private readonly WglContext _context;
|
||||
private readonly EglGlPlatformSurface.IEglWindowGlPlatformSurfaceInfo _info;
|
||||
private IntPtr _hdc;
|
||||
|
||||
public RenderTarget(WglContext context, EglGlPlatformSurface.IEglWindowGlPlatformSurfaceInfo info)
|
||||
{
|
||||
_context = context;
|
||||
@@ -35,13 +36,16 @@ namespace Avalonia.Win32.OpenGl
|
||||
_hdc = context.CreateConfiguredDeviceContext(info.Handle);
|
||||
}
|
||||
|
||||
public bool IsCorrupted => false;
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
WglGdiResourceManager.ReleaseDC(_info.Handle, _hdc);
|
||||
}
|
||||
|
||||
public IGlPlatformSurfaceRenderingSession BeginDraw()
|
||||
public IGlPlatformSurfaceRenderingSession BeginDraw(PixelSize? expectedPixelSize)
|
||||
{
|
||||
// TODO: use expectedPixelSize
|
||||
var oldContext = _context.MakeCurrent(_hdc);
|
||||
|
||||
// Reset to default FBO first
|
||||
|
||||
@@ -61,6 +61,8 @@ namespace Avalonia.iOS.Eagl
|
||||
_fbo = fbo;
|
||||
}
|
||||
|
||||
public bool IsCorrupted => false;
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
CheckThread();
|
||||
@@ -68,8 +70,9 @@ namespace Avalonia.iOS.Eagl
|
||||
_fbo.Dispose();
|
||||
}
|
||||
|
||||
public IGlPlatformSurfaceRenderingSession BeginDraw()
|
||||
public IGlPlatformSurfaceRenderingSession BeginDraw(PixelSize? expectedPixelSize)
|
||||
{
|
||||
// TODO: use expectedPixelSize
|
||||
CheckThread();
|
||||
var restoreContext = _ctx.MakeCurrent();
|
||||
_fbo.Bind();
|
||||
|
||||
Reference in New Issue
Block a user