Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2522677a2f56ebcae8a68d548f882ca6b15b9d78
      
https://github.com/WebKit/WebKit/commit/2522677a2f56ebcae8a68d548f882ca6b15b9d78
  Author: Kimmo Kinnunen <[email protected]>
  Date:   2026-10-05 (Mon, 05 Oct 2026)

  Changed paths:
    M Source/WebCore/html/canvas/WebGL2RenderingContext.cpp
    M Source/WebCore/html/canvas/WebGLDefaultFramebuffer.cpp
    M Source/WebCore/html/canvas/WebGLDefaultFramebuffer.h
    M Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
    M Source/WebCore/html/canvas/WebGLRenderingContextBase.h
    M Source/WebCore/platform/graphics/GraphicsContextGL.h
    M Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp
    M Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.h
    M Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.mm
    M Source/WebCore/testing/Internals.cpp
    M Source/WebCore/testing/Internals.h
    M Source/WebCore/testing/Internals.idl
    M Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.cpp
    M 
Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGLInitializationState.h
    M 
Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGLInitializationState.serialization.in
    M Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp
    M Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.h

  Log Message:
  -----------
  WebGL: Answer the default framebuffer queries in the WebGLRenderingContext 
level
https://bugs.webkit.org/show_bug.cgi?id=325940
rdar://188899947

Reviewed by Mike Wyrzykowski.

Answer the queries about the default framebuffer from the formats that
WebGLDefaultFramebuffer chooses at creation, instead of querying the
GraphicsContextGL. The answers then do not depend on how the default
framebuffer storage is allocated, which is work towards allocating it
only when it is used. They also no longer need a synchronous IPC.

With the default framebuffer bound:
- RED_BITS, GREEN_BITS, BLUE_BITS, ALPHA_BITS, DEPTH_BITS, STENCIL_BITS,
  SAMPLE_BUFFERS and SAMPLES come from the default framebuffer formats
  and sample count.
- IMPLEMENTATION_COLOR_READ_FORMAT and _TYPE are RGBA and UNSIGNED_BYTE,
  and fail with INVALID_OPERATION when the read buffer is NONE, like the
  implementation.
- checkFramebufferStatus() is FRAMEBUFFER_COMPLETE.
- The WebGL 2 FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE and _STENCIL_SIZE come
  from the default framebuffer formats.

Clamp the drawing buffer also to the limit of the compositor buffers.
The GraphicsContextGL clamps the compositor buffers to the IOSurface
limit, which is smaller than the GL limits on iOS family. Before, a
larger canvas kept the compositor buffer at the old size while the
drawing buffer reported the new size. Add
GraphicsContextGL::maxDrawingBufferSize(), cached in the remote context
like the other limits, and internals.webglMaxDrawingBufferSize() for
the size limit test.

* Source/WebCore/html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::getFramebufferAttachmentParameter):
* Source/WebCore/html/canvas/WebGLDefaultFramebuffer.cpp:
(WebCore::WebGLDefaultFramebuffer::WebGLDefaultFramebuffer):
(WebCore::WebGLDefaultFramebuffer::reshape):
* Source/WebCore/html/canvas/WebGLDefaultFramebuffer.h:
(WebCore::WebGLDefaultFramebuffer::depthBits const):
(WebCore::WebGLDefaultFramebuffer::stencilBits const):
(WebCore::WebGLDefaultFramebuffer::sampleCount const):
* Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::initializeContextState):
(WebCore::WebGLRenderingContextBase::checkFramebufferStatus):
(WebCore::WebGLRenderingContextBase::getParameter):
(WebCore::WebGLRenderingContextBase::clampedCanvasSize):
* Source/WebCore/html/canvas/WebGLRenderingContextBase.h:
* Source/WebCore/platform/graphics/GraphicsContextGL.h:
* Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLANGLE::maxDrawingBufferSize):
* Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.h:
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::webglMaxDrawingBufferSize):
* Source/WebCore/testing/Internals.h:
* Source/WebCore/testing/Internals.idl:
* Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.cpp:
(WebKit::RemoteGraphicsContextGL::workQueueInitialize):
* 
Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGLInitializationState.h:
* 
Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGLInitializationState.serialization.in:
* Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp:
(WebKit::RemoteGraphicsContextGLProxy::initialize):
* Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.h:

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



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

Reply via email to