Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 9b39265aab1a6d6852cad1fce149f32625189e7e
https://github.com/WebKit/WebKit/commit/9b39265aab1a6d6852cad1fce149f32625189e7e
Author: Ruthvik Konda <[email protected]>
Date: 2026-05-27 (Wed, 27 May 2026)
Changed paths:
M Source/WebCore/Modules/WebGPU/GPUAdapter.cpp
M Source/WebCore/Modules/WebGPU/GPUBuffer.cpp
M Source/WebCore/Modules/WebGPU/GPUCommandEncoder.cpp
M Source/WebCore/Modules/WebGPU/GPUComputePassEncoder.cpp
M Source/WebCore/Modules/WebGPU/GPUDevice.cpp
M Source/WebCore/Modules/WebGPU/GPUPresentationContext.cpp
M Source/WebCore/Modules/WebGPU/GPUQueue.cpp
M Source/WebCore/Modules/WebGPU/GPURenderPassEncoder.cpp
M Source/WebCore/Modules/WebGPU/Implementation/WebGPUBufferImpl.cpp
M
Source/WebCore/Modules/WebGPU/Implementation/WebGPUCompositorIntegrationImpl.cpp
Log Message:
-----------
Reduce use of `.get()` for smart pointers in WebGPU
https://bugs.webkit.org/show_bug.cgi?id=315612
rdar://177990908
Reviewed by Mike Wyrzykowski.
`RefPtr<T>` and `WeakPtr<T>` provide implicit conversion operators
(`operator!`, `operator bool`, `operator*`, `operator==` against raw
pointers) and a `RefPtr(const WeakPtr<T>&)` constructor that internally
calls `.get()`. Removing redundant `.get()` calls at twenty sites across
ten files in `Source/WebCore/Modules/WebGPU/` simplifies the code
without changing behavior — the operators/constructor invoke `.get()`
themselves.
For the five statement-form `RefPtr` initializations from `WeakPtr`,
also switched from copy-init (`=`) to brace-init (`{}`) per current
WebKit style.
No new tests needed (no behavioral change).
* Source/WebCore/Modules/WebGPU/GPUAdapter.cpp:
(WebCore::GPUAdapter::requestDevice):
* Source/WebCore/Modules/WebGPU/GPUBuffer.cpp:
(WebCore::GPUBuffer::unmap):
* Source/WebCore/Modules/WebGPU/GPUCommandEncoder.cpp:
(WebCore::GPUCommandEncoder::beginRenderPass):
(WebCore::GPUCommandEncoder::beginComputePass):
(WebCore::GPUCommandEncoder::finish):
* Source/WebCore/Modules/WebGPU/GPUComputePassEncoder.cpp:
(WebCore::GPUComputePassEncoder::end):
* Source/WebCore/Modules/WebGPU/GPUDevice.cpp:
(WebCore::GPUDevice::externalTextureForDescriptor):
(WebCore::GPUDevice::createRenderPipelineAsync):
(WebCore::GPUDevice::listenForUncapturedErrors):
* Source/WebCore/Modules/WebGPU/GPUPresentationContext.cpp:
(WebCore::GPUPresentationContext::getCurrentTexture):
* Source/WebCore/Modules/WebGPU/GPUQueue.cpp:
(WebCore::GPUQueue::submit):
(WebCore::getImageBytesFromVideoFrame):
* Source/WebCore/Modules/WebGPU/GPURenderPassEncoder.cpp:
(WebCore::GPURenderPassEncoder::end):
* Source/WebCore/Modules/WebGPU/Implementation/WebGPUBufferImpl.cpp:
(WebCore::WebGPU::BufferImpl::getBufferContents):
*
Source/WebCore/Modules/WebGPU/Implementation/WebGPUCompositorIntegrationImpl.cpp:
(WebCore::WebGPU::CompositorIntegrationImpl::withDisplayBufferAsNativeImage):
Canonical link: https://commits.webkit.org/313955@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications