mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-16 21:20:18 +00:00
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. |
||
---|---|---|
.. | ||
Extensions | ||
EventNames.cpp | ||
EventNames.h | ||
OpenGLContext.cpp | ||
OpenGLContext.h | ||
Types.h | ||
Types.idl | ||
WebGL2RenderingContext.cpp | ||
WebGL2RenderingContext.h | ||
WebGL2RenderingContext.idl | ||
WebGL2RenderingContextBase.idl | ||
WebGL2RenderingContextImpl.cpp | ||
WebGL2RenderingContextImpl.h | ||
WebGL2RenderingContextOverloads.idl | ||
WebGLActiveInfo.cpp | ||
WebGLActiveInfo.h | ||
WebGLActiveInfo.idl | ||
WebGLBuffer.cpp | ||
WebGLBuffer.h | ||
WebGLBuffer.idl | ||
WebGLContextAttributes.cpp | ||
WebGLContextAttributes.h | ||
WebGLContextEvent.cpp | ||
WebGLContextEvent.h | ||
WebGLContextEvent.idl | ||
WebGLFramebuffer.cpp | ||
WebGLFramebuffer.h | ||
WebGLFramebuffer.idl | ||
WebGLObject.cpp | ||
WebGLObject.h | ||
WebGLObject.idl | ||
WebGLProgram.cpp | ||
WebGLProgram.h | ||
WebGLProgram.idl | ||
WebGLQuery.cpp | ||
WebGLQuery.h | ||
WebGLQuery.idl | ||
WebGLRenderbuffer.cpp | ||
WebGLRenderbuffer.h | ||
WebGLRenderbuffer.idl | ||
WebGLRenderingContext.cpp | ||
WebGLRenderingContext.h | ||
WebGLRenderingContext.idl | ||
WebGLRenderingContextBase.h | ||
WebGLRenderingContextBase.idl | ||
WebGLRenderingContextImpl.cpp | ||
WebGLRenderingContextImpl.h | ||
WebGLRenderingContextOverloads.idl | ||
WebGLSampler.cpp | ||
WebGLSampler.h | ||
WebGLSampler.idl | ||
WebGLShader.cpp | ||
WebGLShader.h | ||
WebGLShader.idl | ||
WebGLShaderPrecisionFormat.cpp | ||
WebGLShaderPrecisionFormat.h | ||
WebGLShaderPrecisionFormat.idl | ||
WebGLSync.cpp | ||
WebGLSync.h | ||
WebGLSync.idl | ||
WebGLTexture.cpp | ||
WebGLTexture.h | ||
WebGLTexture.idl | ||
WebGLTransformFeedback.cpp | ||
WebGLTransformFeedback.h | ||
WebGLTransformFeedback.idl | ||
WebGLUniformLocation.cpp | ||
WebGLUniformLocation.h | ||
WebGLUniformLocation.idl | ||
WebGLVertexArrayObject.cpp | ||
WebGLVertexArrayObject.h | ||
WebGLVertexArrayObject.idl |