Closed asurdej-comcast closed 9 months ago
Hi @magomez Can you please take a look here. It is connected to other changes like https://github.com/WebPlatformForEmbedded/WPEWebKit/issues/1134
With this patch we will rely on webkit destruction to destroy compositor resource (native window) as part of egl target destruction so no additional changes for 1134 are needed
@asurdej-comcast I like the approach that you're using to destroy the static context in NicosiaGLGLLayer. But I don't understand what you're doing in the ThreadedCompositor. If this is targeting the nonCompositedWebGL mode only, then changes to the ThreadedCompositor are not required, as it won't really hold any GL resource.
Ah, I get it now. LGTM.
Thanks, ThrededCompositor patch is to trigger egl_target_destroy that is called via didDestroyGLContext() -> LayerTreeHost::didDestroyGLContext() -> AcceleratedSurfaceLibWPE::finalize()
In case of nonCompositedWebGL enabled (Lightning) egl target from renderer backend was never destroyed that was causing crash on egl backend destruction as the backend outlived the target.
This change ensures that egl target is destroyed on LayerTreeHost and ThreadedCompositor destruction freeing native window.
Also need to ensure that static window context from NicosiaGCGLLayer is destroyed before egl target destruction (otherwise it will crash). Add ref counting and destroy global window context when no longer needed. (Can be recreated if neccesary)