Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 26d6f98531c3f61d8c3a690a116d9f56a9f27e87
https://github.com/WebKit/WebKit/commit/26d6f98531c3f61d8c3a690a116d9f56a9f27e87
Author: Adrian Perez de Castro <[email protected]>
Date: 2026-02-04 (Wed, 04 Feb 2026)
Changed paths:
M Source/WebCore/platform/Logging.h
M Source/WebCore/platform/graphics/egl/GLContext.cpp
M Source/WebCore/platform/graphics/egl/GLContext.h
M Source/WebKit/glib/environment-variables.md.in
Log Message:
-----------
[EGL] Support logging debugging contexts
https://bugs.webkit.org/show_bug.cgi?id=306911
Reviewed by Nikolas Zimmermann.
Add a new GLContext logging channel which, when enabled, will cause GL
contexts to be created with the debugging flag set and install a callback
to funnel the messages emitted by the GL implementation to the logging
channel. The GL severity levels (high, medium, low, notification) are
mapped to the WTF log levels (error, warning, info, debug; respectively).
* Source/WebCore/platform/Logging.h: Add the GLContext logging channel.
* Source/WebCore/platform/graphics/egl/GLContext.cpp:
(WebCore::logGLDebugMessage): Callback function invoked by the GL
implementation to log messages, which get forwarded to the GLContext
channel.
(WebCore::GLContext::enableDebugLogging): Helper function to enable
debug logging using a suitable GL extension or the built-int support
in GLES 3.2+.
(WebCore::shouldEnableDebugLogging): Helper function to check whether
the GL context debug loggging channel has been enabled.
(WebCore::GLContext::GLContext): Install the message logging callback
and enable GL_DEBUG_OUTPUT where appropriate, taking care of saving and
restoring the active GL context as needed.
(WebCore::GLContext::createContextForEGLVersion): Enable the
EGL_CONTEXT_OPENGL_DEBUG attribute if context debug logging is
enabled. Remove one use of WTF_ALLOW_UNSAFE_BUFFER_USAGE_{BEGIN,END}
while at it.
* Source/WebCore/platform/graphics/egl/GLContext.h: Add declaration for
the enableDebugLogging() function.
* Source/WebKit/glib/environment-variables.md.in: Document the GLContext
logging channel.
Canonical link: https://commits.webkit.org/306778@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications