diff --git a/source/SkiaSharp.Views/SkiaSharp.Views/Platform/Android/GLTextureView.cs b/source/SkiaSharp.Views/SkiaSharp.Views/Platform/Android/GLTextureView.cs index fb6a9278e3..bd53e8983e 100644 --- a/source/SkiaSharp.Views/SkiaSharp.Views/Platform/Android/GLTextureView.cs +++ b/source/SkiaSharp.Views/SkiaSharp.Views/Platform/Android/GLTextureView.cs @@ -106,7 +106,7 @@ public void SetRenderer(IRenderer renderer) eglWindowSurfaceFactory = new DefaultWindowSurfaceFactory(); } this.renderer = renderer; - glThread = new GLThread(thisWeakRef); + glThread = new GLThread(thisWeakRef, Width, Height); glThread.Start(); } @@ -211,7 +211,7 @@ protected override void OnAttachedToWindow() { renderMode = glThread.GetRenderMode(); } - glThread = new GLThread(thisWeakRef); + glThread = new GLThread(thisWeakRef, Width, Height); if (renderMode != Rendermode.Continuously) { glThread.SetRenderMode(renderMode); @@ -713,12 +713,12 @@ private class GLThread private bool surfaceSizeChanged = true; // End of member variables protected by the sGLThreadManager monitor. - public GLThread(WeakReference glTextureViewWeakRef) + public GLThread(WeakReference glTextureViewWeakRef, int initialWidth, int initialHeight) { threadManager = new GLThreadManager(); - width = 0; - height = 0; + width = initialWidth; + height = initialHeight; requestRender = true; renderMode = Rendermode.Continuously; textureViewWeakRef = glTextureViewWeakRef;