From 32ebae4f09d5d2c8228635a546284128488916fe Mon Sep 17 00:00:00 2001 From: SimonvBez <31727669+SimonvBez@users.noreply.github.com> Date: Sun, 24 Nov 2024 13:32:02 +0100 Subject: [PATCH] Fixed SKGLView on Android not being rendered when using a TabBar (#2550) --- .../SkiaSharp.Views/Platform/Android/GLTextureView.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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;