Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b388badda30401104caccaac01c12c59efb119d5
      
https://github.com/WebKit/WebKit/commit/b388badda30401104caccaac01c12c59efb119d5
  Author: Kimmo Kinnunen <[email protected]>
  Date:   2026-05-06 (Wed, 06 May 2026)

  Changed paths:
    M LayoutTests/webgl/query-context-lost-restore-expected.txt
    M LayoutTests/webgl/query-context-lost-restore.html
    M Source/WebCore/html/canvas/WebGL2RenderingContext.cpp
    M Source/WebCore/html/canvas/WebGL2RenderingContext.h
    M Source/WebCore/html/canvas/WebGLRenderingContext.cpp
    M Source/WebCore/html/canvas/WebGLRenderingContext.h
    M Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
    M Source/WebCore/html/canvas/WebGLRenderingContextBase.h

  Log Message:
  -----------
  WebGL: Subobjects should be detached from context on context loss
https://bugs.webkit.org/show_bug.cgi?id=314068
rdar://176257432

Reviewed by Dan Glastonbury.

The context should detach all the objects it points to
when context loss happens. This fixes bugs related to
initializeContextState not initializing these objects
and makes it testable to test the behavior.

Fixes a thread-safety crash where WebGL disjoint timer query
ref would be taken in GC thread.

* LayoutTests/webgl/query-context-lost-restore-expected.txt:
* LayoutTests/webgl/query-context-lost-restore.html:
* Source/WebCore/html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::~WebGL2RenderingContext):
(WebCore::WebGL2RenderingContext::initializeContextState):
(WebCore::WebGL2RenderingContext::initializeDefaultObjects):
(WebCore::WebGL2RenderingContext::detachAndRemoveAllObjects):
* Source/WebCore/html/canvas/WebGL2RenderingContext.h:
* Source/WebCore/html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::~WebGLRenderingContext):
(WebCore::WebGLRenderingContext::detachAndRemoveAllObjects):
(WebCore::WebGLRenderingContext::addMembersToOpaqueRoots):
(WebCore::WebGLRenderingContext::initializeContextState): Deleted.
* Source/WebCore/html/canvas/WebGLRenderingContext.h:
* Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::~WebGLRenderingContextBase):
(WebCore::WebGLRenderingContextBase::forceLostContext):
(WebCore::WebGLRenderingContextBase::maybeRestoreContext):
(WebCore::WebGLRenderingContextBase::detachAndRemoveAllObjects):
(WebCore::WebGLRenderingContextBase::loseExtensions): Deleted.
* Source/WebCore/html/canvas/WebGLRenderingContextBase.h:

Canonical link: https://commits.webkit.org/312678@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to