Browse Source

Introduced several 5-line .cs files

pull/1935/head
Nikita Tsukanov 8 years ago
parent
commit
4f1552c6a2
  1. 18
      src/Avalonia.OpenGL/EglGlPlatformSurface.cs
  2. 8
      src/Avalonia.OpenGL/GlDisplayType.cs
  3. 8
      src/Avalonia.OpenGL/IGlContext.cs
  4. 20
      src/Avalonia.OpenGL/IGlDisplay.cs
  5. 15
      src/Avalonia.OpenGL/IGlPlatformSurface.cs
  6. 9
      src/Avalonia.OpenGL/IGlPlatformSurfaceRenderTarget.cs
  7. 12
      src/Avalonia.OpenGL/IGlPlatformSurfaceRenderingSession.cs
  8. 10
      src/Avalonia.OpenGL/IGlSurface.cs
  9. 8
      src/Gtk/Avalonia.Gtk3/WindowBaseImpl.cs
  10. 6
      src/Windows/Avalonia.Win32/WindowImpl.cs

18
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
src/Avalonia.OpenGL/GlDisplayType.cs

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

8
src/Avalonia.OpenGL/IGlContext.cs

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

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();
}
}

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
src/Avalonia.OpenGL/IGlPlatformSurfaceRenderTarget.cs

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

12
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
src/Avalonia.OpenGL/IGlSurface.cs

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

8
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;
}
}

6
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;
}
}

Loading…
Cancel
Save