From 2f5f82a8e0b637f5566736e789b41577a72f773e Mon Sep 17 00:00:00 2001 From: Ramez Ragaa Date: Fri, 9 Aug 2024 00:15:18 +0300 Subject: [PATCH] chore: build errors --- doc/articles/controls/GLCanvasElement.md | 6 +++-- doc/articles/controls/SKCanvasElement.md | 20 +++++++++-------- .../GLCanvasElement_Cube.xaml | 6 +++-- .../GLCanvasElement_Simple.xaml | 6 +++-- .../RotatingCubeGlCanvasElement.skia.cs | 2 ++ .../SKCanvasElementImpl.skia.cs | 2 ++ .../SKCanvasElement_Simple.xaml | 20 +++++++++-------- .../SimpleTriangleGlCanvasElement.skia.cs | 2 ++ .../UI/Xaml/Graphics/GLCanvasElement.skia.cs | 22 +++++++++---------- 9 files changed, 51 insertions(+), 35 deletions(-) diff --git a/doc/articles/controls/GLCanvasElement.md b/doc/articles/controls/GLCanvasElement.md index 9ca9aeff2559..95ce47780ecb 100644 --- a/doc/articles/controls/GLCanvasElement.md +++ b/doc/articles/controls/GLCanvasElement.md @@ -77,8 +77,10 @@ XAML: d:DesignHeight="300" d:DesignWidth="400"> - - + + + + ``` diff --git a/doc/articles/controls/SKCanvasElement.md b/doc/articles/controls/SKCanvasElement.md index dd4d15fd21f8..a09f95499f00 100644 --- a/doc/articles/controls/SKCanvasElement.md +++ b/doc/articles/controls/SKCanvasElement.md @@ -47,15 +47,17 @@ XAML: d:DesignHeight="300" d:DesignWidth="400"> - - - - - - - - - + + + + + + + + + + + ``` diff --git a/src/SamplesApp/UITests.Shared/Windows_UI_Composition/GLCanvasElement_Cube.xaml b/src/SamplesApp/UITests.Shared/Windows_UI_Composition/GLCanvasElement_Cube.xaml index ff704f05689f..c0b57fdbecd8 100644 --- a/src/SamplesApp/UITests.Shared/Windows_UI_Composition/GLCanvasElement_Cube.xaml +++ b/src/SamplesApp/UITests.Shared/Windows_UI_Composition/GLCanvasElement_Cube.xaml @@ -10,6 +10,8 @@ d:DesignHeight="300" d:DesignWidth="400"> - - + + + + diff --git a/src/SamplesApp/UITests.Shared/Windows_UI_Composition/GLCanvasElement_Simple.xaml b/src/SamplesApp/UITests.Shared/Windows_UI_Composition/GLCanvasElement_Simple.xaml index 4de8bee29112..d7746386788b 100644 --- a/src/SamplesApp/UITests.Shared/Windows_UI_Composition/GLCanvasElement_Simple.xaml +++ b/src/SamplesApp/UITests.Shared/Windows_UI_Composition/GLCanvasElement_Simple.xaml @@ -10,6 +10,8 @@ d:DesignHeight="300" d:DesignWidth="400"> - - + + + + diff --git a/src/SamplesApp/UITests.Shared/Windows_UI_Composition/RotatingCubeGlCanvasElement.skia.cs b/src/SamplesApp/UITests.Shared/Windows_UI_Composition/RotatingCubeGlCanvasElement.skia.cs index b2b4f84dc040..f9e6f725d371 100644 --- a/src/SamplesApp/UITests.Shared/Windows_UI_Composition/RotatingCubeGlCanvasElement.skia.cs +++ b/src/SamplesApp/UITests.Shared/Windows_UI_Composition/RotatingCubeGlCanvasElement.skia.cs @@ -11,6 +11,7 @@ // https://github.com/dotnet/Silk.NET/tree/c27224cce6b8136224c01d40de2d608879d709b5/examples/CSharp/OpenGL%20Tutorials +#if __SKIA__ using System; using System.Diagnostics; using System.Numerics; @@ -284,3 +285,4 @@ public unsafe void VertexAttributePointer(uint index, int count, VertexAttribPoi } } } +#endif diff --git a/src/SamplesApp/UITests.Shared/Windows_UI_Composition/SKCanvasElementImpl.skia.cs b/src/SamplesApp/UITests.Shared/Windows_UI_Composition/SKCanvasElementImpl.skia.cs index c4828f2b7b36..dd3c99d8c3f6 100644 --- a/src/SamplesApp/UITests.Shared/Windows_UI_Composition/SKCanvasElementImpl.skia.cs +++ b/src/SamplesApp/UITests.Shared/Windows_UI_Composition/SKCanvasElementImpl.skia.cs @@ -1,3 +1,4 @@ +#if __SKIA__ using System; using Windows.Foundation; using Microsoft.UI.Xaml; @@ -132,3 +133,4 @@ SKPath Star() } } } +#endif diff --git a/src/SamplesApp/UITests.Shared/Windows_UI_Composition/SKCanvasElement_Simple.xaml b/src/SamplesApp/UITests.Shared/Windows_UI_Composition/SKCanvasElement_Simple.xaml index dcb9d9652030..7f3874309498 100644 --- a/src/SamplesApp/UITests.Shared/Windows_UI_Composition/SKCanvasElement_Simple.xaml +++ b/src/SamplesApp/UITests.Shared/Windows_UI_Composition/SKCanvasElement_Simple.xaml @@ -10,13 +10,15 @@ d:DesignHeight="300" d:DesignWidth="400"> - - - - - - - - - + + + + + + + + + + + diff --git a/src/SamplesApp/UITests.Shared/Windows_UI_Composition/SimpleTriangleGlCanvasElement.skia.cs b/src/SamplesApp/UITests.Shared/Windows_UI_Composition/SimpleTriangleGlCanvasElement.skia.cs index 703fc9ba13e3..d0ff70a00393 100644 --- a/src/SamplesApp/UITests.Shared/Windows_UI_Composition/SimpleTriangleGlCanvasElement.skia.cs +++ b/src/SamplesApp/UITests.Shared/Windows_UI_Composition/SimpleTriangleGlCanvasElement.skia.cs @@ -1,3 +1,4 @@ +#if __SKIA__ using System; using System.Drawing; using Microsoft.UI.Xaml.Controls; @@ -105,3 +106,4 @@ protected override void RenderOverride(GL gl) } } } +#endif diff --git a/src/Uno.UI/UI/Xaml/Graphics/GLCanvasElement.skia.cs b/src/Uno.UI/UI/Xaml/Graphics/GLCanvasElement.skia.cs index 4b2e8c2a0d03..83b8a0482cb2 100644 --- a/src/Uno.UI/UI/Xaml/Graphics/GLCanvasElement.skia.cs +++ b/src/Uno.UI/UI/Xaml/Graphics/GLCanvasElement.skia.cs @@ -135,7 +135,7 @@ private protected override unsafe void OnLoaded() { throw new InvalidOperationException("Offscreen framebuffer is not complete"); } - + Init(_gl); } _gl.BindFramebuffer(GLEnum.Framebuffer, 0); @@ -163,16 +163,16 @@ private unsafe void Render() } private protected override void OnUnloaded() - { - Marshal.FreeHGlobal(_pixels); - - if (_gl is { }) - { - _gl.DeleteFramebuffer(_framebuffer); - _gl.DeleteTexture(_textureColorBuffer); - _gl.DeleteRenderbuffer(_renderBuffer); - } - } + { + Marshal.FreeHGlobal(_pixels); + + if (_gl is { }) + { + _gl.DeleteFramebuffer(_framebuffer); + _gl.DeleteTexture(_textureColorBuffer); + _gl.DeleteRenderbuffer(_renderBuffer); + } + } /// /// By default, uses all the given. Subclasses of