danwalmsley
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with
12 additions and
14 deletions
-
src/Avalonia.Native/GlPlatformFeature.cs
-
src/Avalonia.OpenGL/EglGlPlatformSurface.cs
-
src/Avalonia.OpenGL/IGlPlatformSurfaceRenderingSession.cs
-
src/Gtk/Avalonia.Gtk3/WindowBaseImpl.cs
-
src/Skia/Avalonia.Skia/GlRenderTarget.cs
-
src/Windows/Avalonia.Win32/WindowImpl.cs
|
|
|
@ -100,12 +100,12 @@ namespace Avalonia.Native |
|
|
|
|
|
|
|
public IGlDisplay Display { get; } |
|
|
|
|
|
|
|
public System.Drawing.Size PixelSize |
|
|
|
public PixelSize Size |
|
|
|
{ |
|
|
|
get |
|
|
|
{ |
|
|
|
var s = _session.GetPixelSize(); |
|
|
|
return new System.Drawing.Size(s.Width, s.Height); |
|
|
|
return new PixelSize(s.Width, s.Height); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -7,8 +7,7 @@ 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; } |
|
|
|
PixelSize Size { get; } |
|
|
|
double Scaling { get; } |
|
|
|
} |
|
|
|
|
|
|
|
@ -71,7 +70,7 @@ namespace Avalonia.OpenGL |
|
|
|
} |
|
|
|
|
|
|
|
public IGlDisplay Display => _context.Display; |
|
|
|
public System.Drawing.Size PixelSize => _info.PixelSize; |
|
|
|
public PixelSize Size => _info.Size; |
|
|
|
public double Scaling => _info.Scaling; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -5,8 +5,7 @@ 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; } |
|
|
|
PixelSize Size { get; } |
|
|
|
double Scaling { get; } |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -510,12 +510,12 @@ namespace Avalonia.Gtk3 |
|
|
|
: new ImmediateRenderer(root); |
|
|
|
} |
|
|
|
|
|
|
|
System.Drawing.Size EglGlPlatformSurface.IEglWindowGlPlatformSurfaceInfo.PixelSize |
|
|
|
PixelSize EglGlPlatformSurface.IEglWindowGlPlatformSurfaceInfo.Size |
|
|
|
{ |
|
|
|
get |
|
|
|
{ |
|
|
|
var cs = ClientSize; |
|
|
|
return new System.Drawing.Size((int)Math.Max(1, LastKnownScaleFactor * cs.Width), |
|
|
|
return new PixelSize((int)Math.Max(1, LastKnownScaleFactor * cs.Width), |
|
|
|
(int)Math.Max(1, LastKnownScaleFactor * ClientSize.Height)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -28,7 +28,7 @@ namespace Avalonia.Skia |
|
|
|
var gl = disp.GlInterface; |
|
|
|
gl.GetIntegerv(GL_FRAMEBUFFER_BINDING, out var fb); |
|
|
|
|
|
|
|
var size = session.PixelSize; |
|
|
|
var size = session.Size; |
|
|
|
var scaling = session.Scaling; |
|
|
|
|
|
|
|
GRBackendRenderTargetDesc desc = new GRBackendRenderTargetDesc |
|
|
|
|
|
|
|
@ -933,14 +933,14 @@ namespace Avalonia.Win32 |
|
|
|
|
|
|
|
_topmost = value; |
|
|
|
} |
|
|
|
|
|
|
|
System.Drawing.Size EglGlPlatformSurface.IEglWindowGlPlatformSurfaceInfo.PixelSize |
|
|
|
|
|
|
|
PixelSize EglGlPlatformSurface.IEglWindowGlPlatformSurfaceInfo.Size |
|
|
|
{ |
|
|
|
get |
|
|
|
{ |
|
|
|
RECT rect; |
|
|
|
GetClientRect(_hwnd, out rect); |
|
|
|
return new System.Drawing.Size( |
|
|
|
return new PixelSize( |
|
|
|
Math.Max(1, rect.right - rect.left), |
|
|
|
Math.Max(1, rect.bottom - rect.top)); |
|
|
|
} |
|
|
|
|