]> O.S.I.I.S - jp/crow.git/commitdiff
vkvg backend nearly ok, refresh problem
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Thu, 25 Nov 2021 03:11:52 +0000 (04:11 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Thu, 25 Nov 2021 03:11:52 +0000 (04:11 +0100)
13 files changed:
Backends/CairoBackend/CairoBackend.csproj
Backends/CairoBackend/src/EGLDevice.cs
Backends/CairoBackend/src/GLDevice.cs
Backends/CairoBackend/src/ImageBackend.cs
Backends/VkvgBackend/src/Context.cs
Backends/VkvgBackend/src/DefaultBackend.cs [new file with mode: 0644]
Backends/VkvgBackend/src/Device.cs
Backends/VkvgBackend/src/Surface.cs
Crow/Crow.csproj
Crow/src/Interface.cs
Drawing2D/src/IBackend.cs
Samples/Directory.Build.props
Samples/PerfTests/Program.cs

index bc11bc47c3869a5968b97d2b4a81de91920b4d42..986ad8592515ef23ca9e19a3c7fffc54b1f8f537 100644 (file)
@@ -6,11 +6,12 @@
   </PropertyGroup>
 
   <ItemGroup>
-         <Compile Include="src\**\*.cs" Exclude="src\NativeMethods-internal.cs"/>
+         <Compile Include="src\**\*.cs" Exclude="src\NativeMethods-internal.cs" />
   </ItemGroup>
 
   <ItemGroup>
     <PackageReference Include="glfw-sharp" Version="$(GlfwSharpVersion)" />
+    <PackageReference Include="OpenGL.Net" Version="0.8.4" />
     <ProjectReference Include="..\..\Drawing2D\Drawing2D.csproj" />
   </ItemGroup>
 
index d9296b74e60da1973e3c0c5da157a014ba212aba..ef3d5542a1920551c45fbef179751b4a543cb379 100644 (file)
@@ -28,7 +28,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 using System;
-using Drawing2D;
 
 namespace Crow.CairoBackend
 {
@@ -39,9 +38,7 @@ namespace Crow.CairoBackend
                {
                        SetThreadAware(threadAwayre);
                }
-               /*public override ISurface CreateSurface(int width, int height)
-                       => new ImageSurface (Format.ARGB32, width, height);
-               public override ISurface CreateSurface (IntPtr nativeWindoPointer, int width, int height) {
+               /*public override ISurface CreateSurface (IntPtr nativeWindoPointer, int width, int height) {
                        return new GLSurface (this, Glfw.Glfw3.GetEGLSurface (nativeWindoPointer), width, height);
                }*/
 
index c7992b74eb5cee0f7133d044dcd9dac1725b6e22..d90fe1a0acf11589efa1e5d95194608fe419edb3 100644 (file)
@@ -2,6 +2,9 @@
 //
 // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
 using System;
+using Drawing2D;
+using OpenGL;
+using static OpenGL.Gl;
 
 namespace Crow.CairoBackend
 {
@@ -11,6 +14,15 @@ namespace Crow.CairoBackend
                public void SetThreadAware (bool value) {
                        NativeMethods.cairo_gl_device_set_thread_aware (handle, value ? 1 : 0);
                }
+               public virtual ISurface CreateSurface(int width, int height) {
+                       uint tex = GenTexture ();
+                       BindTexture (TextureTarget.Texture2d, tex);
+                       TexImage2D (TextureTarget.Texture2d, 0, InternalFormat.Rgb, width, height,
+                               0, PixelFormat.Rgb, PixelType.UnsignedByte, 0);
+                       TexParameteri(TextureTarget.Texture2d, TextureParameterName.TextureMagFilter, NEAREST);
+                       TexParameteri(TextureTarget.Texture2d, TextureParameterName.TextureMinFilter, NEAREST);
+                       return new GLSurface (this, Content.ColorAlpha, tex, width, height);
+               }
 
        }
 }
index e390ca98cb43a70e5cc21d95db35cf48a45a7b4a..7443b787c410b3d394e85be2752e1ad6779526e6 100644 (file)
@@ -156,8 +156,10 @@ namespace Crow.CairoBackend
                                ctx.Dispose ();
                        clipping = null;
                }
-
-
+               public void ResizeMainSurface (int width, int height)
+               {
+                       surf.Resize (width, height);
+               }
                #region IDispose implementation
                bool isDisposed;
                public void Dispose ()
index 20a3cdaa3ddc28b43011065249af998967de7ecb..f303b09f79a45d0ed04b0bdbee0af754b836db29 100644 (file)
@@ -14,7 +14,7 @@ namespace Crow.VkvgBackend
 
                IntPtr handle = IntPtr.Zero;
 
-               public Context(Surface surf)
+               public Context (ISurface surf)
                {
                        handle = NativeMethods.vkvg_create(surf.Handle);
                        this.FillRule = FillRule.NonZero;
@@ -310,7 +310,7 @@ namespace Crow.VkvgBackend
 
                public void SelectFontFace(string family, FontSlant slant, FontWeight weight)
                {
-                       throw new NotImplementedException();
+                       NativeMethods.vkvg_select_font_face (handle, family);
                }
 
                internal static byte[] TerminateUtf8(string s)
diff --git a/Backends/VkvgBackend/src/DefaultBackend.cs b/Backends/VkvgBackend/src/DefaultBackend.cs
new file mode 100644 (file)
index 0000000..6879380
--- /dev/null
@@ -0,0 +1,299 @@
+// Copyright (c) 2021  Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices;
+using Drawing2D;
+using Glfw;
+using vke;
+using Vulkan;
+using static Vulkan.Vk;
+using Device = vke.Device;
+
+namespace Crow.Backends
+{
+       public class DefaultBackend : IBackend
+       {
+               protected Instance instance;
+               protected PhysicalDevice phy;
+               protected vke.Device dev;
+               protected Queue graphicQueue;   //for vkvg, we must have at least a graphic queue
+               protected IntPtr hWin;                  //GLFW window native pointer.
+               protected VkSurfaceKHR hSurf;   //Vulkan Surface
+               protected SwapChain swapChain;
+               protected CommandPool cmdPool;
+               protected PrimaryCommandBuffer[] cmds;
+               protected VkSemaphore[] drawComplete;
+               protected Fence drawFence;
+               VkvgBackend.Surface surf;
+               Crow.VkvgBackend.Device vkvgDev;
+               SampleCount samples = SampleCount.Sample_1;
+               bool vsync = false;
+
+               bool tryGetPhy (vke.PhysicalDeviceCollection physicalDevices, VkPhysicalDeviceType phyType, out PhysicalDevice phy, bool swapchainSupport) {
+                       phy = physicalDevices.FirstOrDefault (p => p.Properties.deviceType == phyType && p.HasSwapChainSupport == swapchainSupport);
+                       return phy != null;
+               }
+               public DefaultBackend (int width, int height)
+               {
+#if DEBUG
+                       instance = new Instance (Ext.I.VK_EXT_debug_utils);
+#else
+                       instance = new Instance ();
+#endif
+                       vke.PhysicalDeviceCollection phys = instance.GetAvailablePhysicalDevice ();
+                       if (phys.Count() == 0)
+                               throw new Exception ("[Crow.VkvgBackend] No vulkan hardware found.");
+
+                       if (!tryGetPhy (phys, VkPhysicalDeviceType.DiscreteGpu, out phy, false))
+                               if (!tryGetPhy (phys, VkPhysicalDeviceType.IntegratedGpu, out phy, false))
+                                       phy = phys[0];
+
+                       VkPhysicalDeviceFeatures enabledFeatures = default;
+                       dev = new vke.Device (phy);
+                       graphicQueue = new Queue (dev, VkQueueFlags.Graphics);
+                       dev.Activate (enabledFeatures);
+
+                       vkvgDev = new Crow.VkvgBackend.Device (
+                               instance.Handle, phy.Handle, dev.VkDev.Handle, graphicQueue.qFamIndex, samples);
+
+                       surf = new VkvgBackend.Surface (vkvgDev, (int)width, (int)height);
+               }
+               public DefaultBackend (IntPtr nativeWindoPointer, int width, int height)
+               {
+                       hWin = nativeWindoPointer;
+
+                       SwapChain.IMAGES_USAGE = VkImageUsageFlags.ColorAttachment | VkImageUsageFlags.TransferDst;
+                       SwapChain.PREFERED_FORMAT = VkFormat.B8g8r8a8Unorm;
+
+                       List<string> instExts = new List<string> (Glfw3.GetRequiredInstanceExtensions ());
+#if DEBUG
+                       instExts.Add (Ext.I.VK_EXT_debug_utils);
+#endif
+                       instance = new Instance (instExts.ToArray());
+                       hSurf = instance.CreateSurface (hWin);
+
+                       vke.PhysicalDeviceCollection phys = instance.GetAvailablePhysicalDevice ();
+                       if (phys.Count() == 0)
+                               throw new Exception ("[Crow.VkvgBackend] No vulkan hardware found.");
+
+                       if (!tryGetPhy (phys, VkPhysicalDeviceType.DiscreteGpu, out phy, true))
+                               if (!tryGetPhy (phys, VkPhysicalDeviceType.IntegratedGpu, out phy, true))
+                                       phy = phys[0];
+
+                       VkPhysicalDeviceFeatures enabledFeatures = default;
+                       dev = new vke.Device (phy);
+                       graphicQueue = new PresentQueue (dev, VkQueueFlags.Graphics, hSurf);
+
+                       dev.Activate (enabledFeatures, Ext.D.VK_KHR_swapchain);
+
+                       swapChain = new SwapChain (graphicQueue as PresentQueue, (uint)width, (uint)height, SwapChain.PREFERED_FORMAT,
+                               vsync ? VkPresentModeKHR.FifoKHR : VkPresentModeKHR.ImmediateKHR);
+                       swapChain.Activate ();
+
+                       /*width = swapChain.Width;
+                       height = swapChain.Height;*/
+
+                       cmdPool = new CommandPool (dev, graphicQueue.qFamIndex, VkCommandPoolCreateFlags.ResetCommandBuffer);
+                       cmds = cmdPool.AllocateCommandBuffer (swapChain.ImageCount);
+
+                       drawComplete = new VkSemaphore[swapChain.ImageCount];
+                       drawFence = new Fence (dev, true, "draw fence");
+
+                       for (int i = 0; i < swapChain.ImageCount; i++) {
+                               drawComplete[i] = dev.CreateSemaphore ();
+                               drawComplete[i].SetDebugMarkerName (dev, "Semaphore DrawComplete" + i);
+                       }
+
+                       cmdPool.SetName ("main CmdPool");
+
+                       vkvgDev = new Crow.VkvgBackend.Device (
+                               instance.Handle, phy.Handle, dev.VkDev.Handle, graphicQueue.qFamIndex, samples);
+
+                       createMainSurface ((uint)width, (uint)height);
+               }
+               ~DefaultBackend ()
+               {
+                       Dispose (false);
+               }
+               public virtual ISurface CreateSurface(int width, int height)
+                       => new Crow.VkvgBackend.Surface (vkvgDev, width, height);
+               public virtual ISurface CreateSurface(byte[] data, int width, int height)
+                       => new Crow.VkvgBackend.Surface (vkvgDev, data, width, height);
+               public ISurface MainSurface => surf;
+               public IRegion CreateRegion () => new Crow.VkvgBackend.Region ();
+               public IContext CreateContext (ISurface surf)
+               {
+                       Crow.VkvgBackend.Context gr = new Crow.VkvgBackend.Context (surf);
+                       return gr;
+               }
+               //IPattern CreatePattern (PatternType patternType);
+               public IGradient CreateGradient (GradientType gradientType, Rectangle bounds)
+               {
+                       switch (gradientType) {
+                       case GradientType.Vertical:
+                               return new Crow.VkvgBackend.LinearGradient (bounds.Left, bounds.Top, bounds.Left, bounds.Bottom);
+                       case GradientType.Horizontal:
+                               return new Crow.VkvgBackend.LinearGradient (bounds.Left, bounds.Top, bounds.Right, bounds.Top);
+                       case GradientType.Oblic:
+                               return new Crow.VkvgBackend.LinearGradient (bounds.Left, bounds.Top, bounds.Right, bounds.Bottom);
+                       case GradientType.Radial:
+                               throw new NotImplementedException ();
+                       }
+                       return null;
+               }
+               public byte[] LoadBitmap (Stream stream, out Size dimensions)
+               {
+                       byte[] image;
+#if STB_SHARP
+                       StbImageSharp.ImageResult stbi = StbImageSharp.ImageResult.FromStream (stream, StbImageSharp.ColorComponents.RedGreenBlueAlpha);
+                       image = new byte[stbi.Data.Length];
+
+                       Array.Copy (stbi.Data, image, stbi.Data.Length);
+                       dimensions = new Size (stbi.Width, stbi.Height);
+#else
+                       using (StbImage stbi = new StbImage (stream)) {
+                               image = new byte [stbi.Size];
+                               Marshal.Copy (stbi.Handle, image, 0, stbi.Size);
+                               dimensions = new Size (stbi.Width, stbi.Height);
+                       }
+#endif
+                       return image;
+               }
+               public ISvgHandle LoadSvg(Stream stream)
+               {
+                       using (BinaryReader sr = new BinaryReader (stream))
+                               return new VkvgBackend.SvgHandle(vkvgDev, sr.ReadBytes ((int)stream.Length));
+               }
+               public ISvgHandle LoadSvg(string svgFragment) =>
+                       new VkvgBackend.SvgHandle (vkvgDev,System.Text.Encoding.Unicode.GetBytes (svgFragment));
+               bool disposeContextOnFlush;
+               IRegion clipping;
+               protected void clear(IContext ctx) {
+                       for (int i = 0; i < clipping.NumRectangles; i++)
+                               ctx.Rectangle (clipping.GetRectangle (i));
+
+                       ctx.ClipPreserve ();
+                       ctx.Operator = Operator.Clear;
+                       ctx.Fill ();
+                       ctx.Operator = Operator.Over;
+               }
+               public IContext PrepareUIFrame(IContext existingContext, IRegion clipping)
+               {
+                       this.clipping = clipping;
+                       IContext ctx = existingContext;
+                       if (ctx == null) {
+                               disposeContextOnFlush = true;
+                               ctx = new VkvgBackend.Context (MainSurface);
+                       } else
+                               disposeContextOnFlush = false;
+
+                       clear (ctx);
+
+                       return ctx;
+               }
+               public void FlushUIFrame(IContext ctx)
+               {
+                       if (disposeContextOnFlush)
+                               ctx.Dispose ();
+                       clipping = null;
+
+                       dev.WaitIdle();
+
+                       int idx = swapChain.GetNextImage ();
+                       if (idx < 0) {
+                               createMainSurface (swapChain.Width, swapChain.Height);
+                               return;
+                       }
+
+                       drawFence.Wait ();
+                       drawFence.Reset ();
+
+                       graphicQueue.Submit (cmds[idx], swapChain.presentComplete, drawComplete[idx], drawFence);
+                       (graphicQueue as PresentQueue).Present (swapChain, drawComplete[idx]);
+
+                       dev.WaitIdle();
+               }
+               public void ResizeMainSurface (int width, int height) {
+                       //resize is done on swapchain image aquisition failure
+               }
+               vke.Image blitSource;
+               void createMainSurface (uint width, uint height) {
+                       dev.WaitIdle();
+
+                       blitSource?.Dispose ();
+                       surf?.Dispose ();
+                       surf = new VkvgBackend.Surface (vkvgDev, (int)width, (int)height);
+
+                       cmdPool.Reset();
+
+                       blitSource = new vke.Image (dev,
+                               new Vulkan.VkImage((ulong)surf.VkImage.ToInt64()),
+                               Vulkan.VkFormat.B8g8r8a8Unorm,
+                               Vulkan.VkImageUsageFlags.TransferSrc | Vulkan.VkImageUsageFlags.TransferDst | Vulkan.VkImageUsageFlags.ColorAttachment,
+                               width, height);
+
+                       for (int i = 0; i < swapChain.ImageCount; i++) {
+                               vke.Image blitDest = swapChain.images[i];
+                               vke.PrimaryCommandBuffer cmd = cmds[i];
+                               cmd.Start();
+
+                               blitDest.SetLayout (cmd, VkImageAspectFlags.Color,
+                                       VkImageLayout.Undefined, VkImageLayout.TransferDstOptimal,
+                                       VkPipelineStageFlags.BottomOfPipe, VkPipelineStageFlags.Transfer);
+
+                               blitSource.SetLayout (cmd, VkImageAspectFlags.Color,
+                                       VkImageLayout.ColorAttachmentOptimal, VkImageLayout.TransferSrcOptimal,
+                                       VkPipelineStageFlags.ColorAttachmentOutput, VkPipelineStageFlags.Transfer);
+
+                               blitSource.BlitTo (cmd, blitDest, VkFilter.Nearest);
+
+                               blitDest.SetLayout (cmd, VkImageAspectFlags.Color,
+                                       VkImageLayout.TransferDstOptimal, VkImageLayout.PresentSrcKHR,
+                                       VkPipelineStageFlags.Transfer, VkPipelineStageFlags.BottomOfPipe);
+
+                               blitSource.SetLayout (cmd, VkImageAspectFlags.Color,
+                                       VkImageLayout.TransferSrcOptimal, VkImageLayout.ColorAttachmentOptimal,
+                                       VkPipelineStageFlags.Transfer, VkPipelineStageFlags.ColorAttachmentOutput);
+
+                               cmd.End ();
+                       }
+                       dev.WaitIdle ();
+               }
+               #region IDispose implementation
+               bool isDisposed;
+               public void Dispose ()
+               {
+                       Dispose (true);
+                       GC.SuppressFinalize (this);
+               }
+               protected virtual void Dispose (bool disposing)
+               {
+                       if (!isDisposed && disposing) {
+                               dev.WaitIdle ();
+
+                               surf.Dispose ();
+                               vkvgDev.Dispose ();
+
+                               for (int i = 0; i < swapChain.ImageCount; i++) {
+                                       dev.DestroySemaphore (drawComplete[i]);
+                                       cmds[i].Free ();
+                               }
+                               drawFence.Dispose ();
+                               swapChain.Dispose ();
+                               cmdPool.Dispose ();
+
+                               vkDestroySurfaceKHR (instance.Handle, hSurf, IntPtr.Zero);
+
+                               dev.Dispose ();
+                               instance.Dispose ();
+                       }
+                       isDisposed = true;
+               }
+               #endregion
+       }
+}
index c2bd40b2f9024e7d509d9a6cf51f1bd4e83a7cdb..82cad101f7f4c0d4442274a1f74815ea15a78050 100644 (file)
@@ -32,58 +32,6 @@ namespace Crow.VkvgBackend
                #region IDevice implementation
                public void GetDpy (out int hdpy, out int vdpy) => NativeMethods.vkvg_device_get_dpy (handle, out hdpy, out vdpy);
                public void SetDpy (int hdpy, int vdpy) => NativeMethods.vkvg_device_set_dpy (handle, hdpy, vdpy);
-
-               public IRegion CreateRegion() => new Region ();
-
-               public ISurface CreateSurface(int width, int height)
-               {
-                       throw new NotImplementedException();
-               }
-
-               public ISurface CreateSurface(byte[] data, int width, int height)
-               {
-                       throw new NotImplementedException();
-               }
-               public ISurface CreateSurface(IntPtr glfwWinHandle, int width, int height)
-               {
-                       throw new NotImplementedException();
-               }
-               public IContext CreateContext(ISurface surf)
-               {
-                       throw new NotImplementedException();
-               }
-
-               public IGradient CreateGradient(GradientType gradientType, Rectangle bounds)
-               {
-                       throw new NotImplementedException();
-               }
-               public byte[] LoadBitmap (Stream stream, out Size dimensions) {
-                       byte[] image;
-#if STB_SHARP
-                       StbImageSharp.ImageResult stbi = StbImageSharp.ImageResult.FromStream (stream, StbImageSharp.ColorComponents.RedGreenBlueAlpha);
-                       image = new byte[stbi.Data.Length];
-
-                       Array.Copy (stbi.Data, image, stbi.Data.Length);
-                       dimensions = new Size (stbi.Width, stbi.Height);
-#else
-                       using (StbImage stbi = new StbImage (stream)) {
-                               image = new byte [stbi.Size];
-                               Marshal.Copy (stbi.Handle, image, 0, stbi.Size);
-                               dimensions = new Size (stbi.Width, stbi.Height);
-                       }
-#endif
-                       return image;
-               }
-
-               public ISvgHandle LoadSvg(Stream stream)
-               {
-                       throw new NotImplementedException();
-               }
-
-               public ISvgHandle LoadSvg(string svgFragment)
-               {
-                       throw new NotImplementedException();
-               }
                #endregion
 
 
index 1c04b204b0a6f5f91aeae5d3e1352a8b95cc3baa..b32feef629684e59e71b7dee23da55073c22a1f6 100644 (file)
@@ -36,9 +36,9 @@ namespace Crow.VkvgBackend
                        AddReference ();
                }
 
-               Surface (IntPtr devHandle, int width, int heigth)
+               Surface (IntPtr devHandle, int width, int height)
                {
-                       handle = NativeMethods.vkvg_surface_create (devHandle, (uint)width, (uint)heigth);
+                       handle = NativeMethods.vkvg_surface_create (devHandle, (uint)width, (uint)height);
                }
                #endregion
                ~Surface ()
@@ -58,7 +58,8 @@ namespace Crow.VkvgBackend
 
                public void Resize(int width, int height)
                {
-                       throw new NotImplementedException();
+                       NativeMethods.vkvg_surface_destroy (handle);
+                       handle = NativeMethods.vkvg_surface_create (vkvgDev.Handle, (uint)width, (uint)height);
                }
 
                public void Flush () {
index ffe4e8668cbfb855feea1342d8befcb82900641e..97866d71277f73b33269347c9f11d45794b43a50 100644 (file)
@@ -74,7 +74,8 @@
 
        <ItemGroup>
          <ProjectReference Include="..\Drawing2D\Drawing2D.csproj" />
-         <ProjectReference Include="..\Backends\CairoBackend\CairoBackend.csproj" />
+         <!--<ProjectReference Include="..\Backends\CairoBackend\CairoBackend.csproj" />-->
+         <ProjectReference Include="..\Backends\VkvgBackend\VkvgBackend.csproj" />
        </ItemGroup>
 
        <PropertyGroup Condition=" '$(CrowStbSharp)' == 'true'">
index 19d12f3f26d67975edf852d7433a4418b8d06a0c..a3870a3aa4a4237d7973b2200ea7e81644c4e1cd 100644 (file)
@@ -402,7 +402,7 @@ namespace Crow
                }
 
                protected virtual void initBackend () {
-                       backend = new Crow.CairoBackend.ImageBackend (hWin, clientRectangle.Width, clientRectangle.Height);
+                       backend = new Crow.Backends.DefaultBackend (hWin, clientRectangle.Width, clientRectangle.Height);
                        clipping = Backend.CreateRegion ();
                }
                /// <summary>
@@ -412,8 +412,9 @@ namespace Crow
                {
                        Glfw3.Init ();
 
-                       Glfw3.WindowHint (WindowAttribute.ClientApi, Constants.OpenglEsApi);
-                       Glfw3.WindowHint (WindowAttribute.ContextVersionMajor, 3);
+                       //Glfw3.WindowHint (WindowAttribute.ClientApi, Constants.OpenglEsApi);
+                       Glfw3.WindowHint (WindowAttribute.ClientApi, 0);
+                       //Glfw3.WindowHint (WindowAttribute.ContextVersionMajor, 3);
                        //Glfw3.WindowHint (WindowAttribute.ContextVersionMajor, 0);
                        Glfw3.WindowHint (WindowAttribute.ContextCreationApi, Constants.EglContextApi);
 
@@ -1431,7 +1432,7 @@ namespace Crow
                public virtual void ProcessResize(Rectangle bounds){
                        lock (UpdateMutex) {
                                clientRectangle = bounds;
-                               MainSurface.Resize (clientRectangle.Width, clientRectangle.Height);
+                               backend.ResizeMainSurface (clientRectangle.Width, clientRectangle.Height);
                                foreach (Widget g in GraphicTree)
                                        g.RegisterForLayouting (LayoutingType.All);
 
index 811b95d532c3ff2ffe4ef3dccb827b94a98b1c2d..ac5271622d51ffbc77f5f50f47ab357a38a1afba 100644 (file)
@@ -22,6 +22,7 @@ namespace Drawing2D
                ISvgHandle LoadSvg (string svgFragment);
                IContext PrepareUIFrame (IContext existingContext, IRegion clipping);
                void FlushUIFrame (IContext ctx);
+               void ResizeMainSurface (int width, int height);
                /*IRegion CreateRegion ();
                ISurface CreateSurface (int width, int height);
                ISurface CreateSurface (byte[] data, int width, int height);
index 3445954770cf996d53a653a7fa3ba8db2148da9c..1fa6dd1617c32c784638d34d7c597d22921fb59b 100644 (file)
@@ -2,7 +2,7 @@
        <PropertyGroup>
                <TargetFrameworks>netcoreapp3.1</TargetFrameworks>
                <!--<TargetFrameworks>net5</TargetFrameworks>-->
-               <OutputType>WinExe</OutputType>
+               <OutputType>Exe</OutputType>
 
                <SolutionDir>$(MSBuildThisFileDirectory)..\</SolutionDir>
                <OutputPath>$(SolutionDir)build\$(Configuration)\</OutputPath>
index cbe6273889c8e5a5038288981e6e33b699a56d70..d7797496c23cc54b0d689a65879c6857c761d23f 100644 (file)
@@ -161,9 +161,9 @@ namespace PerfTests
                protected override void initBackend()
                {
                        if (screenOutput)
-                               backend = new Crow.CairoBackend.ImageBackend (WindowHandle, clientRectangle.Width, clientRectangle.Height);
+                               backend = new Crow.Backends.DefaultBackend (WindowHandle, clientRectangle.Width, clientRectangle.Height);
                        else
-                               backend = new Crow.CairoBackend.ImageBackend (clientRectangle.Width, clientRectangle.Height);
+                               backend = new Crow.Backends.DefaultBackend (clientRectangle.Width, clientRectangle.Height);
 
                        clipping = Backend.CreateRegion ();
                }