Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d57237a9c78977bfa95cbce9804daf82cfd42131
      
https://github.com/WebKit/WebKit/commit/d57237a9c78977bfa95cbce9804daf82cfd42131
  Author: Sergio Villar Senin <[email protected]>
  Date:   2025-11-24 (Mon, 24 Nov 2025)

  Changed paths:
    M Source/WebCore/Headers.cmake
    A Source/WebCore/Modules/WebGPU/InternalAPI/WebGPUXRLayerBacking.h
    M Source/WebCore/Modules/WebGPU/InternalAPI/WebGPUXRProjectionLayer.h
    M Source/WebCore/Modules/webxr/XRCompositionLayer.cpp
    M Source/WebCore/Modules/webxr/XRCompositionLayer.h
    M Source/WebCore/Modules/webxr/XRGPUBinding.cpp
    A Source/WebCore/Modules/webxr/XRLayerBacking.h
    M Source/WebCore/Modules/webxr/XRProjectionLayer.cpp
    M Source/WebCore/Modules/webxr/XRProjectionLayer.h
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj

  Log Message:
  -----------
  [WebXR] Refactor the layer backings to allow WebGL layers
https://bugs.webkit.org/show_bug.cgi?id=302653

Reviewed by Mike Wyrzykowski.

WebXR layers API can be implemented using either a WebGL backend (as in
the original specification) or using the WebGPU bindings (as it's
currently implemented for Cocoa platforms). The current code however was
developed as if only the WebGPU option was possible and thus does not
easily allow the co-existence of a WebGL backend. That's why we need to
refactor the class that implements the layers backend, known as the
"backing".

A new superclass called XRLayerBacking was added. That's the class that
would be used by the XR composition layers. The WebGPU implementation of
the backing know inherits from that new class.

Apart from that we're also moving the reference to the backing to the
XRCompositionLayer as that would be needed for all composition layer
types and not only for the projection layer.

No new tests required, we're "just" refactoring some code.

* Source/WebCore/Headers.cmake:
* Source/WebCore/Modules/WebGPU/InternalAPI/WebGPUXRLayerBacking.h:
* Source/WebCore/Modules/WebGPU/InternalAPI/WebGPUXRProjectionLayer.h:
* Source/WebCore/Modules/webxr/XRCompositionLayer.cpp:
(WebCore::XRCompositionLayer::XRCompositionLayer):
(WebCore::XRCompositionLayer::backing):
* Source/WebCore/Modules/webxr/XRCompositionLayer.h:
* Source/WebCore/Modules/webxr/XRGPUBinding.cpp:
(WebCore::XRGPUBinding::getSubImage):
* Source/WebCore/Modules/webxr/XRLayerBacking.h:
(WebCore::XRLayerBacking::startFrame):
(WebCore::XRLayerBacking::endFrame):
* Source/WebCore/Modules/webxr/XRProjectionLayer.cpp:
(WebCore::XRProjectionLayer::XRProjectionLayer):
(WebCore::XRProjectionLayer::endFrame):
(WebCore::XRProjectionLayer::textureWidth const):
(WebCore::XRProjectionLayer::textureHeight const):
(WebCore::XRProjectionLayer::textureArrayLength const):
(WebCore::XRProjectionLayer::backing):
* Source/WebCore/Modules/webxr/XRProjectionLayer.h:
(WebCore::XRProjectionLayer::create):
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:

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



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

Reply via email to