Browse Source

whitespace.

pull/1935/head
Dan Walmsley 8 years ago
parent
commit
f2bd597329
  1. 3
      src/Avalonia.OpenGL/EglDisplay.cs
  2. 1
      src/Avalonia.OpenGL/EglGlPlatformFeature.cs
  3. 3
      src/Avalonia.OpenGL/EglGlPlatformSurface.cs
  4. 2
      src/Avalonia.OpenGL/EglInterface.cs
  5. 2
      src/Avalonia.OpenGL/GlInterface.cs
  6. 7
      src/Skia/Avalonia.Skia/GlRenderTarget.cs
  7. 3
      src/Windows/Avalonia.Win32/Win32GlManager.cs

3
src/Avalonia.OpenGL/EglDisplay.cs

@ -3,6 +3,7 @@ using System.ComponentModel;
using System.Runtime.InteropServices;
using Avalonia.Platform.Interop;
using static Avalonia.OpenGL.EglConsts;
namespace Avalonia.OpenGL
{
public class EglDisplay : IGlDisplay
@ -201,6 +202,4 @@ namespace Avalonia.OpenGL
}
}
}
}

1
src/Avalonia.OpenGL/EglGlPlatformFeature.cs

@ -3,7 +3,6 @@ using Avalonia.Logging;
namespace Avalonia.OpenGL
{
public class EglGlPlatformFeature : IWindowingPlatformGlFeature
{
public IGlDisplay Display { get; set; }

3
src/Avalonia.OpenGL/EglGlPlatformSurface.cs

@ -10,13 +10,11 @@ namespace Avalonia.OpenGL
// 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;
public EglGlPlatformSurface(EglDisplay display, IGlContext context, IEglWindowGlPlatformSurfaceInfo info)
{
@ -79,3 +77,4 @@ namespace Avalonia.OpenGL
}
}
}

2
src/Avalonia.OpenGL/EglInterface.cs

@ -33,7 +33,6 @@ namespace Avalonia.OpenGL
return (s, o) => dyn.GetProcAddress(lib, s, o);
}
// ReSharper disable UnassignedGetOnlyAutoProperty
public delegate IntPtr EglGetDisplay(IntPtr nativeDisplay);
[EntryPoint("eglGetDisplay")]
@ -90,6 +89,5 @@ namespace Avalonia.OpenGL
public EglGetConfigAttrib GetConfigAttrib { get; }
// ReSharper restore UnassignedGetOnlyAutoProperty
}
}

2
src/Avalonia.OpenGL/GlInterface.cs

@ -9,7 +9,6 @@ namespace Avalonia.OpenGL
{
private readonly Func<string, bool, IntPtr> _getProcAddress;
public GlInterface(Func<string, bool, IntPtr> getProcAddress) : base(getProcAddress)
{
_getProcAddress = getProcAddress;
@ -44,7 +43,6 @@ namespace Avalonia.OpenGL
[EntryPoint("glGetIntegerv")]
public GlGetIntegerv GetIntegerv { get; }
// ReSharper restore UnassignedGetOnlyAutoProperty
}
}

7
src/Skia/Avalonia.Skia/GlRenderTarget.cs

@ -5,6 +5,7 @@ using Avalonia.Platform;
using Avalonia.Rendering;
using SkiaSharp;
using static Avalonia.OpenGL.GlConsts;
namespace Avalonia.Skia
{
public class GlRenderTarget : IRenderTarget
@ -26,8 +27,10 @@ namespace Avalonia.Skia
var disp = session.Display;
var gl = disp.GlInterface;
gl.GetIntegerv(GL_FRAMEBUFFER_BINDING, out var fb);
var size = session.PixelSize;
var scaling = session.Scaling;
GRBackendRenderTargetDesc desc = new GRBackendRenderTargetDesc
{
Width = size.Width,
@ -38,10 +41,12 @@ namespace Avalonia.Skia
Origin=GRSurfaceOrigin.BottomLeft,
RenderTargetHandle = new IntPtr(fb)
};
gl.Viewport(0, 0, desc.Width, desc.Height);
gl.ClearStencil(0);
gl.ClearColor(0, 0, 0, 0);
gl.Clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
var surface = SKSurface.Create(_grContext, desc);
var nfo = new DrawingContextImpl.CreateInfo
@ -52,13 +57,13 @@ namespace Avalonia.Skia
VisualBrushRenderer = visualBrushRenderer,
DisableTextLcdRendering = true
};
return new DrawingContextImpl(nfo, Disposable.Create(() =>
{
surface.Canvas.Flush();
surface.Dispose();
session.Dispose();
}));
}
}
}

3
src/Windows/Avalonia.Win32/Win32GlManager.cs

@ -7,7 +7,8 @@ namespace Avalonia.Win32
/// <summary>This property is initialized if drawing platform requests OpenGL support</summary>
public static EglGlPlatformFeature EglFeature { get; private set; }
private static bool s_attemptedToInitialize;
private static bool s_attemptedToInitialize;
public static void Initialize()
{
AvaloniaLocator.CurrentMutable.Bind<IWindowingPlatformGlFeature>().ToFunc(() =>

Loading…
Cancel
Save