ladybird/Libraries/LibWeb/WebGL
Erik Kurzinger 0189553bed LibWeb/WebGL: Avoid freeing GL objects belonging to other contexts
The free_surface_resources() function in OpenGLContext.cpp is
responsible for freeing all GL and EGL objects tied to the lifetime of
the painting surface. It is called when the associated canvas is resized
or destroyed. However, if there are multiple WebGL canvases and another
canvas's context is current when the function is called, it will
unintentionally free GL objects belonging to that other context.

To fix this, we call eglMakeCurrent at the start of
free_surface_resources(). This ensures that we will be deleting the
intended objects.

Note that m_impl->surface could be EGL_NO_SURFACE if
free_surface_resources() is called before the painting surface has been
created, but that should be fine. EGL_KHR_surfaceless_context support is
ubiquitous at this point.
2025-08-30 15:49:11 +02:00
..
Extensions LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
EventNames.cpp LibWeb: Remove the initialize_strings methods 2025-01-12 00:35:58 +01:00
EventNames.h LibWeb: Remove the initialize_strings methods 2025-01-12 00:35:58 +01:00
OpenGLContext.cpp LibWeb/WebGL: Avoid freeing GL objects belonging to other contexts 2025-08-30 15:49:11 +02:00
OpenGLContext.h LibWeb: Enable EXPLICIT_SYMBOL_EXPORT 2025-08-23 16:04:36 -06:00
Types.h
Types.idl
WebGL2RenderingContext.cpp LibWeb/WebGL: Use eglWaitUntilWorkScheduledANGLE instead of glFlush 2025-06-09 15:40:41 -06:00
WebGL2RenderingContext.h LibWeb/WebGL2: Implement EXT_color_buffer_float extension 2025-03-06 12:59:28 +01:00
WebGL2RenderingContext.idl
WebGL2RenderingContextBase.idl LibWeb/WebGL2: Implement getActiveUniforms 2025-02-09 01:00:51 +01:00
WebGL2RenderingContextImpl.cpp LibWeb+Meta: Move WebGL rendering context implementations in tree 2025-07-02 19:00:49 +02:00
WebGL2RenderingContextImpl.h LibWeb+Meta: Move WebGL rendering context implementations in tree 2025-07-02 19:00:49 +02:00
WebGL2RenderingContextOverloads.idl LibWeb/WebGL: Implement compressedTex(Sub)Image2D 2025-02-09 01:00:51 +01:00
WebGLActiveInfo.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
WebGLActiveInfo.h
WebGLActiveInfo.idl
WebGLBuffer.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
WebGLBuffer.h
WebGLBuffer.idl
WebGLContextAttributes.cpp LibJS+LibWeb+WebContent: Port JS::PropertyKey to UTF-16 2025-08-05 07:07:15 -04:00
WebGLContextAttributes.h
WebGLContextEvent.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
WebGLContextEvent.h
WebGLContextEvent.idl
WebGLFramebuffer.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
WebGLFramebuffer.h
WebGLFramebuffer.idl
WebGLObject.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
WebGLObject.h LibWeb: Enable EXPLICIT_SYMBOL_EXPORT 2025-08-23 16:04:36 -06:00
WebGLObject.idl
WebGLProgram.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
WebGLProgram.h LibWeb/WebGL: Return vertex shader from Program::attached_vertex_shader 2025-05-26 17:16:42 +03:00
WebGLProgram.idl
WebGLQuery.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
WebGLQuery.h
WebGLQuery.idl
WebGLRenderbuffer.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
WebGLRenderbuffer.h
WebGLRenderbuffer.idl
WebGLRenderingContext.cpp LibWeb/WebGL: Use eglWaitUntilWorkScheduledANGLE instead of glFlush 2025-06-09 15:40:41 -06:00
WebGLRenderingContext.h LibWeb/WebGL: Implement EXT_blend_minmax extension 2025-04-07 23:21:11 +02:00
WebGLRenderingContext.idl
WebGLRenderingContextBase.h LibWeb: Add OffscreenCanvas to IDL types 2025-06-30 09:46:21 -06:00
WebGLRenderingContextBase.idl LibWeb: Fix typos - act II 2025-04-09 15:05:20 +01:00
WebGLRenderingContextImpl.cpp LibWeb+Meta: Move WebGL rendering context implementations in tree 2025-07-02 19:00:49 +02:00
WebGLRenderingContextImpl.h LibWeb+Meta: Move WebGL rendering context implementations in tree 2025-07-02 19:00:49 +02:00
WebGLRenderingContextOverloads.idl LibWeb: Add OffscreenCanvas to IDL types 2025-06-30 09:46:21 -06:00
WebGLSampler.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
WebGLSampler.h
WebGLSampler.idl
WebGLShader.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
WebGLShader.h LibWeb/WebGL: Track the shaders attached to a program 2025-01-21 21:36:05 +01:00
WebGLShader.idl
WebGLShaderPrecisionFormat.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
WebGLShaderPrecisionFormat.h
WebGLShaderPrecisionFormat.idl
WebGLSync.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
WebGLSync.h
WebGLSync.idl
WebGLTexture.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
WebGLTexture.h
WebGLTexture.idl
WebGLTransformFeedback.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
WebGLTransformFeedback.h
WebGLTransformFeedback.idl
WebGLUniformLocation.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
WebGLUniformLocation.h
WebGLUniformLocation.idl
WebGLVertexArrayObject.cpp LibWeb: Only set prototype once for object with IDL interface 2025-04-20 18:43:11 +02:00
WebGLVertexArrayObject.h
WebGLVertexArrayObject.idl