Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 59e13430ba6a62f57fa7583742a1e7f356332f9d
https://github.com/WebKit/WebKit/commit/59e13430ba6a62f57fa7583742a1e7f356332f9d
Author: Sergio Villar Senin <[email protected]>
Date: 2026-04-27 (Mon, 27 Apr 2026)
Changed paths:
M Source/WebCore/Modules/webxr/WebXRSystem.h
M Source/WebCore/Modules/webxr/WebXRWebGLLayer.cpp
M Source/WebCore/Modules/webxr/XREquirectLayer.cpp
M Source/WebCore/Modules/webxr/XREquirectLayer.h
M Source/WebCore/Modules/webxr/XRWebGLBinding.cpp
M Source/WebCore/Modules/webxr/XRWebGLBinding.h
M Source/WebCore/Modules/webxr/XRWebGLBinding.idl
A Source/WebCore/Modules/webxr/XRWebGLEquirectLayerBacking.cpp
A Source/WebCore/Modules/webxr/XRWebGLEquirectLayerBacking.h
M Source/WebCore/Sources.txt
M Source/WebCore/platform/xr/PlatformXR.h
M Source/WebCore/testing/WebFakeXRDevice.cpp
M Source/WebCore/testing/WebFakeXRDevice.h
M Source/WebKit/Shared/XR/PlatformXR.serialization.in
M Source/WebKit/Shared/XR/XRDeviceProxy.cpp
M Source/WebKit/Shared/XR/XRDeviceProxy.h
M Source/WebKit/UIProcess/XR/PlatformXRCoordinator.h
M Source/WebKit/UIProcess/XR/PlatformXRSystem.cpp
M Source/WebKit/UIProcess/XR/PlatformXRSystem.h
M Source/WebKit/UIProcess/XR/PlatformXRSystem.messages.in
M Source/WebKit/UIProcess/XR/openxr/OpenXRLayer.cpp
M Source/WebKit/UIProcess/XR/openxr/OpenXRLayer.h
M Source/WebKit/UIProcess/XR/openxr/PlatformXROpenXR.cpp
M Source/WebKit/UIProcess/XR/openxr/PlatformXROpenXR.h
M Source/WebKit/UIProcess/XR/openxr/PlatformXRSystemOpenXR.cpp
M Source/WebKit/WebProcess/XR/PlatformXRSystemProxy.cpp
M Source/WebKit/WebProcess/XR/PlatformXRSystemProxy.h
M Tools/Scripts/webkitpy/style/checkers/cpp.py
M Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py
Log Message:
-----------
[WebXR][OpenXR] Support Equirect layer
https://bugs.webkit.org/show_bug.cgi?id=312168
Reviewed by Dan Glastonbury.
This implements the required changes to create equirect layers on UIProcess
side and share them with the WebProcess so that web authors could use
them in their WebXR experiences.
This includes not only mono equirect layers (same image in both eyes) but
also top-bottom and left-to-right which are also supported. Authors can
even force a stereo layer to be presented as a mono layer at any point
in time, something that is also supported.
As in the case of the quad and projection layers, texture arrays are not
supported yet but they'll be eventually added.
The only platform implementation supporting the equirect layer will
initially be the OpenXR one which supports the equirect layer via
the XR_KHR_composition_layer_equirect2 extension. Special code had to be added
for the top-bottom cases to support different graphics libraries that
might treat the Y-axis direction in different ways (OpenGL vs Vulkan).
For the case of Apple platforms we had to add some code that will be
eventually removed but that is needed in order not to break Apple
internal systems. That change required also fine tunning the style rule
checkers for spaces before brackets.
No new tests required as the API to create the equirect layers is already
being tested by current tests.
* Source/WebCore/Modules/webxr/WebXRSystem.h:
* Source/WebCore/Modules/webxr/WebXRWebGLLayer.cpp:
(WebCore::WebXRWebGLLayer::endFrame):
* Source/WebCore/Modules/webxr/XREquirectLayer.cpp:
(WebCore::XREquirectLayer::XREquirectLayer):
(WebCore::XREquirectLayer::space const):
(WebCore::XREquirectLayer::setSpace):
(WebCore::XREquirectLayer::transform const):
(WebCore::XREquirectLayer::setTransform):
(WebCore::XREquirectLayer::startFrame):
(WebCore::XREquirectLayer::recomputePose):
(WebCore::XREquirectLayer::endFrame):
* Source/WebCore/Modules/webxr/XREquirectLayer.h:
(WebCore::XREquirectLayer::create):
(WebCore::XREquirectLayer::radius const):
(WebCore::XREquirectLayer::setRadius):
(WebCore::XREquirectLayer::centralHorizontalAngle const):
(WebCore::XREquirectLayer::setCentralHorizontalAngle):
(WebCore::XREquirectLayer::upperVerticalAngle const):
(WebCore::XREquirectLayer::setUpperVerticalAngle):
(WebCore::XREquirectLayer::lowerVerticalAngle const):
(WebCore::XREquirectLayer::setLowerVerticalAngle):
(WebCore::XREquirectLayer::space const): Deleted.
(WebCore::XREquirectLayer::setSpace): Deleted.
(WebCore::XREquirectLayer::transform const): Deleted.
(WebCore::XREquirectLayer::setTransform): Deleted.
* Source/WebCore/Modules/webxr/XRWebGLBinding.cpp:
(WebCore::XRWebGLBinding::validateCompositionLayerInitParameters const):
(WebCore::XRWebGLBinding::createQuadLayer):
(WebCore::XRWebGLBinding::createEquirectLayer):
* Source/WebCore/Modules/webxr/XRWebGLBinding.h:
(WebCore::XRWebGLBinding::createEquirectLayer): Deleted.
* Source/WebCore/Modules/webxr/XRWebGLBinding.idl:
* Source/WebCore/Modules/webxr/XRWebGLEquirectLayerBacking.cpp: Added.
(WebCore::XRWebGLEquirectLayerBacking::create):
(WebCore::XRWebGLEquirectLayerBacking::XRWebGLEquirectLayerBacking):
* Source/WebCore/Modules/webxr/XRWebGLEquirectLayerBacking.h: Copied from
Source/WebCore/Modules/webxr/XREquirectLayer.cpp.
* Source/WebCore/Sources.txt:
* Source/WebCore/platform/xr/PlatformXR.h:
* Source/WebCore/testing/WebFakeXRDevice.cpp:
(WebCore::SimulatedXRDevice::createCompositionLayer):
(WebCore::SimulatedXRDevice::createQuadLayer):
(WebCore::SimulatedXRDevice::createEquirectLayer):
* Source/WebCore/testing/WebFakeXRDevice.h:
* Source/WebKit/Shared/XR/PlatformXR.serialization.in:
* Source/WebKit/Shared/XR/XRDeviceProxy.cpp:
(WebKit::XRDeviceProxy::createEquirectLayer):
* Source/WebKit/Shared/XR/XRDeviceProxy.h:
* Source/WebKit/UIProcess/XR/PlatformXRCoordinator.h:
(WebKit::PlatformXRCoordinator::createQuadLayer):
(WebKit::PlatformXRCoordinator::createEquirectLayer):
* Source/WebKit/UIProcess/XR/PlatformXRSystem.cpp:
(WebKit::PlatformXRSystem::createEquirectLayer):
* Source/WebKit/UIProcess/XR/PlatformXRSystem.h:
* Source/WebKit/UIProcess/XR/PlatformXRSystem.messages.in:
* Source/WebKit/UIProcess/XR/openxr/OpenXRLayer.cpp:
(WebKit::OpenXREquirectLayer::create):
(WebKit::OpenXREquirectLayer::OpenXREquirectLayer):
(WebKit::OpenXREquirectLayer::startFrame):
* Source/WebKit/UIProcess/XR/openxr/OpenXRLayer.h:
* Source/WebKit/UIProcess/XR/openxr/PlatformXROpenXR.cpp:
(WebKit::OpenXRCoordinator::createEquirectLayer):
(WebKit::OpenXRCoordinator::createInstance):
* Source/WebKit/UIProcess/XR/openxr/PlatformXROpenXR.h:
* Source/WebKit/UIProcess/XR/openxr/PlatformXRSystemOpenXR.cpp:
(WebKit::PlatformXRSystem::createEquirectLayer):
* Source/WebKit/WebProcess/XR/PlatformXRSystemProxy.cpp:
(WebKit::PlatformXRSystemProxy::createEquirectLayer):
* Source/WebKit/WebProcess/XR/PlatformXRSystemProxy.h:
* Tools/Scripts/webkitpy/style/checkers/cpp.py:
(check_spacing):
* Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py:
(CppStyleTest):
Canonical link: https://commits.webkit.org/312072@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications