[webkit-changes] [WebKit/WebKit] a2684c: GraphicsContextGLCocoa does not signal context los...

Kimmo Kinnunen noreply at github.com
Sun Apr 23 23:56:15 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a2684c1fef12d5e6c462081cf6aca95c13ee81cc
      https://github.com/WebKit/WebKit/commit/a2684c1fef12d5e6c462081cf6aca95c13ee81cc
  Author: Kimmo Kinnunen <kkinnunen at apple.com>
  Date:   2023-04-23 (Sun, 23 Apr 2023)

  Changed paths:
    M Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
    M Source/WebCore/html/canvas/WebGLRenderingContextBase.h
    M Source/WebCore/platform/graphics/GraphicsContextGL.cpp
    M Source/WebCore/platform/graphics/GraphicsContextGL.h
    M Source/WebCore/platform/graphics/GraphicsContextGLEnums.h
    M Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp
    M Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.mm
    M Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.cpp
    M Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.h
    M Tools/TestWebKitAPI/Tests/WebCore/cocoa/TestGraphicsContextGLCocoa.mm

  Log Message:
  -----------
  GraphicsContextGLCocoa does not signal context loss immediately on failed prepare
https://bugs.webkit.org/show_bug.cgi?id=254911
rdar://problem/107553596

Reviewed by Dean Jackson.

Previously, if a new surface could not be allocated during prepare for display,
the error would be signalled on the next context call during makeContextCurrent().

This had the problem that makeContextCurrent() would need to check for
m_displayBufferPbuffer existence. This is a problem since the m_displayBufferPbuffer is
a Cocoa specific variable but preferably makeContextCurrent() would be using only
the GraphicsContextGLANGLE state. This prevents Cocoa specific state from being
declared in GraphicsContextGLCocoa.h.

This also had the problem that makeContextCurrent() should work even if the
display buffer is not allocated. This would be used during construction and
destruction.

Make the code structure less error-prone by signaling the context loss during
prepare, and let the makeContextCurrent() always be able to make the context
current.

This is work towards being able to move the Cocoa specific state to the
Cocoa class.

* Source/WebCore/platform/graphics/GraphicsContextGLEnums.h:
* Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLANGLE::simulateEventForTesting):
* Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.mm:
(WebCore::GraphicsContextGLCocoa::allocateAndBindDisplayBufferBacking):
* Tools/TestWebKitAPI/Tests/WebCore/cocoa/TestGraphicsContextGLCocoa.mm:
(TestWebKitAPI::TEST_P):
(TestWebKitAPI::createDefaultTestContext): Deleted.

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




More information about the webkit-changes mailing list