1
0
Эх сурвалжийг харах

Introduced several 5-line .cs files

Nikita Tsukanov 7 жил өмнө
parent
commit
4f1552c6a2

+ 9 - 9
src/Avalonia.OpenGL/EglGlPlatformSurface.cs

@@ -2,17 +2,17 @@ using System;
 
 namespace Avalonia.OpenGL
 {
-    public interface IEglWindowGlPlatformSurfaceInfo
-    {
-        IntPtr Handle { get; }
-        // TODO: Change to PixelSize struct once https://github.com/AvaloniaUI/Avalonia/pull/1889 is merged
-        System.Drawing.Size PixelSize { get; }
-        double Scaling { get; }
-        
-    }
-    
     public class EglGlPlatformSurface : IGlPlatformSurface
     {
+        public interface IEglWindowGlPlatformSurfaceInfo
+        {
+            IntPtr Handle { get; }
+            // TODO: Change to PixelSize struct once https://github.com/AvaloniaUI/Avalonia/pull/1889 is merged
+            System.Drawing.Size PixelSize { get; }
+            double Scaling { get; }
+        
+        }
+
         private readonly EglDisplay _display;
         private readonly IGlContext _context;
         private readonly IEglWindowGlPlatformSurfaceInfo _info;

+ 8 - 0
src/Avalonia.OpenGL/GlDisplayType.cs

@@ -0,0 +1,8 @@
+namespace Avalonia.OpenGL
+{
+    public enum GlDisplayType
+    {
+        OpenGL2,
+        OpenGLES2
+    }
+}

+ 8 - 0
src/Avalonia.OpenGL/IGlContext.cs

@@ -0,0 +1,8 @@
+namespace Avalonia.OpenGL
+{
+    public interface IGlContext
+    {
+        IGlDisplay Display { get; }
+        void MakeCurrent(IGlSurface surface);
+    }
+}

+ 0 - 20
src/Avalonia.OpenGL/IGlDisplay.cs

@@ -1,5 +1,3 @@
-using System;
-
 namespace Avalonia.OpenGL
 {
     public interface IGlDisplay
@@ -10,22 +8,4 @@ namespace Avalonia.OpenGL
         int SampleCount { get; }
         int StencilSize { get; }
     }
-    
-    public enum GlDisplayType
-    {
-        OpenGL2,
-        OpenGLES2
-    }
-
-    public interface IGlContext
-    {
-        IGlDisplay Display { get; }
-        void MakeCurrent(IGlSurface surface);
-    }
-
-    public interface IGlSurface : IDisposable
-    {
-        IGlDisplay Display { get; }
-        void SwapBuffers();
-    }
 }

+ 0 - 15
src/Avalonia.OpenGL/IGlPlatformSurface.cs

@@ -1,22 +1,7 @@
-using System;
-
 namespace Avalonia.OpenGL
 {
     public interface IGlPlatformSurface
     {
         IGlPlatformSurfaceRenderTarget CreateGlRenderTarget();
     }
-
-    public interface IGlPlatformSurfaceRenderTarget : IDisposable
-    {
-        IGlPlatformSurfaceRenderingSession BeginDraw();
-    }
-
-    public interface IGlPlatformSurfaceRenderingSession : IDisposable
-    {
-        IGlDisplay Display { get; }
-        // TODO: Change to PixelSize struct once https://github.com/AvaloniaUI/Avalonia/pull/1889 is merged
-        System.Drawing.Size PixelSize { get; }
-        double Scaling { get; }
-    }
 }

+ 9 - 0
src/Avalonia.OpenGL/IGlPlatformSurfaceRenderTarget.cs

@@ -0,0 +1,9 @@
+using System;
+
+namespace Avalonia.OpenGL
+{
+    public interface IGlPlatformSurfaceRenderTarget : IDisposable
+    {
+        IGlPlatformSurfaceRenderingSession BeginDraw();
+    }
+}

+ 12 - 0
src/Avalonia.OpenGL/IGlPlatformSurfaceRenderingSession.cs

@@ -0,0 +1,12 @@
+using System;
+
+namespace Avalonia.OpenGL
+{
+    public interface IGlPlatformSurfaceRenderingSession : IDisposable
+    {
+        IGlDisplay Display { get; }
+        // TODO: Change to PixelSize struct once https://github.com/AvaloniaUI/Avalonia/pull/1889 is merged
+        System.Drawing.Size PixelSize { get; }
+        double Scaling { get; }
+    }
+}

+ 10 - 0
src/Avalonia.OpenGL/IGlSurface.cs

@@ -0,0 +1,10 @@
+using System;
+
+namespace Avalonia.OpenGL
+{
+    public interface IGlSurface : IDisposable
+    {
+        IGlDisplay Display { get; }
+        void SwapBuffers();
+    }
+}

+ 4 - 4
src/Gtk/Avalonia.Gtk3/WindowBaseImpl.cs

@@ -15,7 +15,7 @@ using Avalonia.Threading;
 
 namespace Avalonia.Gtk3
 {
-    abstract class WindowBaseImpl : IWindowBaseImpl, IPlatformHandle, IEglWindowGlPlatformSurfaceInfo
+    abstract class WindowBaseImpl : IWindowBaseImpl, IPlatformHandle, EglGlPlatformSurface.IEglWindowGlPlatformSurfaceInfo
     {
         public readonly GtkWindow GtkWidget;
         private IInputRoot _inputRoot;
@@ -510,7 +510,7 @@ namespace Avalonia.Gtk3
                 : new ImmediateRenderer(root);
         }
 
-        System.Drawing.Size IEglWindowGlPlatformSurfaceInfo.PixelSize
+        System.Drawing.Size EglGlPlatformSurface.IEglWindowGlPlatformSurfaceInfo.PixelSize
         {
             get
             {
@@ -519,7 +519,7 @@ namespace Avalonia.Gtk3
                     (int)Math.Max(1, LastKnownScaleFactor * ClientSize.Height));
             }
         }
-        double IEglWindowGlPlatformSurfaceInfo.Scaling => LastKnownScaleFactor;
-        IntPtr IEglWindowGlPlatformSurfaceInfo.Handle => Handle.Handle;
+        double EglGlPlatformSurface.IEglWindowGlPlatformSurfaceInfo.Scaling => LastKnownScaleFactor;
+        IntPtr EglGlPlatformSurface.IEglWindowGlPlatformSurfaceInfo.Handle => Handle.Handle;
     }
 }

+ 3 - 3
src/Windows/Avalonia.Win32/WindowImpl.cs

@@ -19,7 +19,7 @@ using static Avalonia.Win32.Interop.UnmanagedMethods;
 
 namespace Avalonia.Win32
 {
-    public class WindowImpl : IWindowImpl, IEglWindowGlPlatformSurfaceInfo
+    public class WindowImpl : IWindowImpl, EglGlPlatformSurface.IEglWindowGlPlatformSurfaceInfo
     {
         private static readonly List<WindowImpl> s_instances = new List<WindowImpl>();
 
@@ -928,7 +928,7 @@ namespace Avalonia.Win32
             _topmost = value;
         }
         
-        System.Drawing.Size IEglWindowGlPlatformSurfaceInfo.PixelSize
+        System.Drawing.Size EglGlPlatformSurface.IEglWindowGlPlatformSurfaceInfo.PixelSize
         {
             get
             {
@@ -939,6 +939,6 @@ namespace Avalonia.Win32
                     Math.Max(1, rect.bottom - rect.top));
             }
         }
-        IntPtr IEglWindowGlPlatformSurfaceInfo.Handle => Handle.Handle;
+        IntPtr EglGlPlatformSurface.IEglWindowGlPlatformSurfaceInfo.Handle => Handle.Handle;
     }
 }