Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: f3e5851b864323666e900682868f4ac22c98b1e6
https://github.com/WebKit/WebKit/commit/f3e5851b864323666e900682868f4ac22c98b1e6
Author: Devin Rousso <[email protected]>
Date: 2026-07-31 (Fri, 31 Jul 2026)
Changed paths:
A LayoutTests/inspector/canvas/requestContent-webgpu-expected.txt
A LayoutTests/inspector/canvas/requestContent-webgpu.html
M LayoutTests/inspector/canvas/worker-webgpu-expected.txt
M LayoutTests/inspector/canvas/worker-webgpu.html
M LayoutTests/platform/glib/TestExpectations
M LayoutTests/platform/win/TestExpectations
M Source/WebCore/html/canvas/CanvasRenderingContext.h
M Source/WebCore/html/canvas/GPUCanvasContextCocoa.h
M Source/WebCore/html/canvas/GPUCanvasContextCocoa.mm
M Source/WebCore/inspector/InspectorCanvas.cpp
M Source/WebInspectorUI/UserInterface/Models/Canvas.js
M Source/WebInspectorUI/UserInterface/Views/CanvasContentView.js
Log Message:
-----------
Web Inspector: Canvas: support WebGPU content previews
https://bugs.webkit.org/show_bug.cgi?id=320702
Reviewed by Mike Wyrzykowski.
* Source/WebCore/html/canvas/CanvasRenderingContext.h:
* Source/WebCore/html/canvas/GPUCanvasContextCocoa.h:
* Source/WebCore/html/canvas/GPUCanvasContextCocoa.mm:
(WebCore::GPUCanvasContextCocoa::surfaceBufferToImageBuffer):
(WebCore::GPUCanvasContextCocoa::transferToImageBuffer):
(WebCore::GPUCanvasContextCocoa::configure):
(WebCore::GPUCanvasContextCocoa::present):
Track the last presented buffer so snapshots of WebGPU `<canvas>` read the
visible content without advancing the presentation buffer.
Clear the tracked content when it is transferred.
* Source/WebCore/inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::getContentAsDataURL):
Use the configured `<canvas>` for a `GPUDevice` when capturing a snapshot.
Reject `GPUDevice` configured for multiple `<canvas>` since
`Canvas.requestContent` only returns one image.
* Source/WebInspectorUI/UserInterface/Models/Canvas.js:
(WI.Canvas.supportsRequestContentForContextType): Deleted.
(WI.Canvas.prototype.requestContent):
* Source/WebInspectorUI/UserInterface/Views/CanvasContentView.js:
(WI.CanvasContentView.prototype._showError):
Remove the now-unnecessary support check since all `<canvas>` context types
support snapshotting.
* LayoutTests/inspector/canvas/requestContent-webgpu.html: Added.
* LayoutTests/inspector/canvas/requestContent-webgpu-expected.txt: Added.
* LayoutTests/inspector/canvas/worker-webgpu.html:
* LayoutTests/inspector/canvas/worker-webgpu-expected.txt:
* LayoutTests/platform/glib/TestExpectations:
* LayoutTests/platform/win/TestExpectations:
Canonical link: https://commits.webkit.org/318363@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications