Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: eb193e1e75323ffe39ab16f5b883a1daf793d2b9
https://github.com/WebKit/WebKit/commit/eb193e1e75323ffe39ab16f5b883a1daf793d2b9
Author: Kimmo Kinnunen <[email protected]>
Date: 2026-06-11 (Thu, 11 Jun 2026)
Changed paths:
M LayoutTests/platform/glib/TestExpectations
A LayoutTests/webgl/webgl-modify-after-drawimage-expected.txt
A LayoutTests/webgl/webgl-modify-after-drawimage.html
M Source/WebCore/platform/graphics/cocoa/IOSurfaceDrawingBuffer.cpp
Log Message:
-----------
REGRESSION (302334@main): WebGL canvas filled with opaque color, hiding
content beneath it (breaks Construct 3)
https://bugs.webkit.org/show_bug.cgi?id=312987
rdar://175352260
Reviewed by Dan Glastonbury and Simon Fraser.
Commit 302334@main would implement logic where WebGL display or drawing
buffer would be captured to NativeImage.
For Cocoa, it would do this in non-copy fashion: GraphicsContextGLCocoa
would create CGIOSurfaceContexts for each backing store IOSurface, and
create a wrapping CGImage out of that. When WebGL would be modified, it
would use CGIOSurfaceContextInvalidateSurface on the CGIOSurfaceContext
to notify that the data should be migrated away from the IOSurface to
the CGImage prior to any further WebGL modification to then backing
store IOSurface.
This is valid for CGImages that:
- have not been sourced from.
- have been sourced from at CG level but the draw waits in
CGIOSurfaceContext queue.
- have been sourced from and the CGIOSurfaceContext has been flushed,
i.e. the underlying draw is scheduled.
This is not a valid approach when the IOSurface reference has been
encoded to the command buffer of the underlying draw, but the command
buffer is not yet scheduled. I.e draw operation sourcing the IOSurface
has committed but not scheduled.
Fix by flushing CGIOSurfaceContextInvalidateSurface operation.
This ensures that:
- the data is migrated before modifications happen
- the already committed but not scheduled reads are scheduled
Tests: webgl/webgl-modify-after-drawimage.html
* LayoutTests/platform/glib/TestExpectations:
* LayoutTests/webgl/webgl-modify-after-drawimage-expected.txt: Added.
* LayoutTests/webgl/webgl-modify-after-drawimage.html: Added.
* Source/WebCore/platform/graphics/cocoa/IOSurfaceDrawingBuffer.cpp:
(WebCore::IOSurfaceDrawingBuffer::forceCopy):
Canonical link: https://commits.webkit.org/315018@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications