|
|
|
@ -2,7 +2,6 @@ using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using Android.Content; |
|
|
|
using Android.Graphics; |
|
|
|
using Android.Runtime; |
|
|
|
using Android.Views; |
|
|
|
using Android.Views.InputMethods; |
|
|
|
using Avalonia.Android.OpenGL; |
|
|
|
@ -38,11 +37,10 @@ namespace Avalonia.Android.Platform.SkiaPlatform |
|
|
|
_keyboardHelper = new AndroidKeyboardEventsHelper<TopLevelImpl>(this); |
|
|
|
_touchHelper = new AndroidTouchEventsHelper<TopLevelImpl>(this, () => InputRoot, |
|
|
|
GetAvaloniaPointFromEvent); |
|
|
|
|
|
|
|
_gl = GlPlatformSurface.TryCreate(this); |
|
|
|
_framebuffer = new FramebufferManager(this); |
|
|
|
|
|
|
|
RenderScaling = (int)_view.Resources.DisplayMetrics.Density; |
|
|
|
RenderScaling = (int)_view.Scaling; |
|
|
|
|
|
|
|
MaxClientSize = new PixelSize(_view.Resources.DisplayMetrics.WidthPixels, |
|
|
|
_view.Resources.DisplayMetrics.HeightPixels).ToSize(RenderScaling); |
|
|
|
@ -77,7 +75,7 @@ namespace Avalonia.Android.Platform.SkiaPlatform |
|
|
|
|
|
|
|
public IPlatformHandle Handle => _view; |
|
|
|
|
|
|
|
public IEnumerable<object> Surfaces => new object[] { _gl, _framebuffer }; |
|
|
|
public IEnumerable<object> Surfaces => new object[] { _gl, _framebuffer, Handle }; |
|
|
|
|
|
|
|
public IRenderer CreateRenderer(IRenderRoot root) => |
|
|
|
AndroidPlatform.Options.UseDeferredRendering |
|
|
|
@ -216,10 +214,9 @@ namespace Avalonia.Android.Platform.SkiaPlatform |
|
|
|
|
|
|
|
public AcrylicPlatformCompensationLevels AcrylicCompensationLevels => new AcrylicPlatformCompensationLevels(1, 1, 1); |
|
|
|
|
|
|
|
IntPtr EglGlPlatformSurfaceBase.IEglWindowGlPlatformSurfaceInfo.Handle => |
|
|
|
AndroidFramebuffer.ANativeWindow_fromSurface(JNIEnv.Handle, _view.Holder.Surface.Handle); |
|
|
|
IntPtr EglGlPlatformSurfaceBase.IEglWindowGlPlatformSurfaceInfo.Handle => ((IPlatformHandle)_view).Handle; |
|
|
|
|
|
|
|
public PixelSize Size => new PixelSize(_view.Holder.SurfaceFrame.Width(), _view.Holder.SurfaceFrame.Height()); |
|
|
|
public PixelSize Size => _view.Size; |
|
|
|
|
|
|
|
public double Scaling => RenderScaling; |
|
|
|
|
|
|
|
|