Title: [277413] trunk/Source/WebKit
Revision
277413
Author
[email protected]
Date
2021-05-12 17:21:32 -0700 (Wed, 12 May 2021)

Log Message

[WebXR] Implement XRDeviceProxy::submitFrame
https://bugs.webkit.org/show_bug.cgi?id=225718

Patch by Ada Chan <[email protected]> on 2021-05-12
Reviewed by Sam Weinig.

* Shared/Cocoa/XRDeviceProxy.h:
* Shared/Cocoa/XRDeviceProxy.mm:
(WebKit::XRDeviceProxy::submitFrame):
* UIProcess/Cocoa/PlatformXRCoordinator.h:
(WebKit::PlatformXRCoordinator::submitFrame):
* UIProcess/Cocoa/PlatformXRSystem.h:
* UIProcess/Cocoa/PlatformXRSystem.messages.in:
* UIProcess/Cocoa/PlatformXRSystem.mm:
(WebKit::PlatformXRSystem::submitFrame):
* WebProcess/cocoa/PlatformXRSystemProxy.h:
* WebProcess/cocoa/PlatformXRSystemProxy.mm:
(WebKit::PlatformXRSystemProxy::submitFrame):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (277412 => 277413)


--- trunk/Source/WebKit/ChangeLog	2021-05-13 00:17:44 UTC (rev 277412)
+++ trunk/Source/WebKit/ChangeLog	2021-05-13 00:21:32 UTC (rev 277413)
@@ -1,3 +1,23 @@
+2021-05-12  Ada Chan  <[email protected]>
+
+        [WebXR] Implement XRDeviceProxy::submitFrame
+        https://bugs.webkit.org/show_bug.cgi?id=225718
+
+        Reviewed by Sam Weinig.
+
+        * Shared/Cocoa/XRDeviceProxy.h:
+        * Shared/Cocoa/XRDeviceProxy.mm:
+        (WebKit::XRDeviceProxy::submitFrame):
+        * UIProcess/Cocoa/PlatformXRCoordinator.h:
+        (WebKit::PlatformXRCoordinator::submitFrame):
+        * UIProcess/Cocoa/PlatformXRSystem.h:
+        * UIProcess/Cocoa/PlatformXRSystem.messages.in:
+        * UIProcess/Cocoa/PlatformXRSystem.mm:
+        (WebKit::PlatformXRSystem::submitFrame):
+        * WebProcess/cocoa/PlatformXRSystemProxy.h:
+        * WebProcess/cocoa/PlatformXRSystemProxy.mm:
+        (WebKit::PlatformXRSystemProxy::submitFrame):
+
 2021-05-12  Brent Fulgham  <[email protected]>
 
         [Cocoa] Silence uninteresting sandbox reports

Modified: trunk/Source/WebKit/Shared/Cocoa/XRDeviceProxy.h (277412 => 277413)


--- trunk/Source/WebKit/Shared/Cocoa/XRDeviceProxy.h	2021-05-13 00:17:44 UTC (rev 277412)
+++ trunk/Source/WebKit/Shared/Cocoa/XRDeviceProxy.h	2021-05-13 00:21:32 UTC (rev 277413)
@@ -58,6 +58,7 @@
     void requestFrame(PlatformXR::Device::RequestFrameCallback&&) final;
     Optional<PlatformXR::LayerHandle> createLayerProjection(uint32_t, uint32_t, bool) final;
     void deleteLayer(PlatformXR::LayerHandle) override { };
+    void submitFrame(Vector<PlatformXR::Device::Layer>&&) final;
 
     XRDeviceIdentifier m_identifier;
     WeakPtr<PlatformXRSystemProxy> m_xrSystem;

Modified: trunk/Source/WebKit/Shared/Cocoa/XRDeviceProxy.mm (277412 => 277413)


--- trunk/Source/WebKit/Shared/Cocoa/XRDeviceProxy.mm	2021-05-13 00:17:44 UTC (rev 277412)
+++ trunk/Source/WebKit/Shared/Cocoa/XRDeviceProxy.mm	2021-05-13 00:21:32 UTC (rev 277413)
@@ -93,6 +93,12 @@
     return m_xrSystem ? m_xrSystem->createLayerProjection(width, height, alpha) : WTF::nullopt;
 }
 
+void XRDeviceProxy::submitFrame(Vector<PlatformXR::Device::Layer>&&)
+{
+    if (m_xrSystem)
+        m_xrSystem->submitFrame();
+}
+
 } // namespace WebKit
 
 #endif // ENABLE(WEBXR)

Modified: trunk/Source/WebKit/UIProcess/Cocoa/PlatformXRCoordinator.h (277412 => 277413)


--- trunk/Source/WebKit/UIProcess/Cocoa/PlatformXRCoordinator.h	2021-05-13 00:17:44 UTC (rev 277412)
+++ trunk/Source/WebKit/UIProcess/Cocoa/PlatformXRCoordinator.h	2021-05-13 00:21:32 UTC (rev 277413)
@@ -54,6 +54,7 @@
 
     // Session display loop.
     virtual void scheduleAnimationFrame(WebPageProxy&, PlatformXR::Device::RequestFrameCallback&&) = 0;
+    virtual void submitFrame(WebPageProxy&) { }
 };
 
 } // namespace WebKit

Modified: trunk/Source/WebKit/UIProcess/Cocoa/PlatformXRSystem.h (277412 => 277413)


--- trunk/Source/WebKit/UIProcess/Cocoa/PlatformXRSystem.h	2021-05-13 00:17:44 UTC (rev 277412)
+++ trunk/Source/WebKit/UIProcess/Cocoa/PlatformXRSystem.h	2021-05-13 00:21:32 UTC (rev 277413)
@@ -56,6 +56,7 @@
     void initializeTrackingAndRendering();
     void shutDownTrackingAndRendering();
     void requestFrame(CompletionHandler<void(PlatformXR::Device::FrameData&&)>&&);
+    void submitFrame();
 
     WebPageProxy& m_page;
 };

Modified: trunk/Source/WebKit/UIProcess/Cocoa/PlatformXRSystem.messages.in (277412 => 277413)


--- trunk/Source/WebKit/UIProcess/Cocoa/PlatformXRSystem.messages.in	2021-05-13 00:17:44 UTC (rev 277412)
+++ trunk/Source/WebKit/UIProcess/Cocoa/PlatformXRSystem.messages.in	2021-05-13 00:21:32 UTC (rev 277413)
@@ -30,6 +30,7 @@
     InitializeTrackingAndRendering()
     ShutDownTrackingAndRendering()
     RequestFrame() -> (struct PlatformXR::Device::FrameData frameData) Async
+    SubmitFrame()
 }
 
 #endif

Modified: trunk/Source/WebKit/UIProcess/Cocoa/PlatformXRSystem.mm (277412 => 277413)


--- trunk/Source/WebKit/UIProcess/Cocoa/PlatformXRSystem.mm	2021-05-13 00:17:44 UTC (rev 277412)
+++ trunk/Source/WebKit/UIProcess/Cocoa/PlatformXRSystem.mm	2021-05-13 00:21:32 UTC (rev 277413)
@@ -99,8 +99,14 @@
         xrCoordinator->scheduleAnimationFrame(m_page, WTFMove(completionHandler));
 }
 
+void PlatformXRSystem::submitFrame()
+{
+    if (auto* xrCoordinator = PlatformXRSystem::xrCoordinator())
+        xrCoordinator->submitFrame(m_page);
 }
 
+}
+
 #if USE(APPLE_INTERNAL_SDK)
 #include <WebKitAdditions/PlatformXRSystemAdditions.mm>
 #else

Modified: trunk/Source/WebKit/WebProcess/cocoa/PlatformXRSystemProxy.h (277412 => 277413)


--- trunk/Source/WebKit/WebProcess/cocoa/PlatformXRSystemProxy.h	2021-05-13 00:17:44 UTC (rev 277412)
+++ trunk/Source/WebKit/WebProcess/cocoa/PlatformXRSystemProxy.h	2021-05-13 00:21:32 UTC (rev 277413)
@@ -46,6 +46,7 @@
     void shutDownTrackingAndRendering();
     void requestFrame(PlatformXR::Device::RequestFrameCallback&&);
     Optional<PlatformXR::LayerHandle> createLayerProjection(uint32_t, uint32_t, bool);
+    void submitFrame();
 
 private:
     RefPtr<XRDeviceProxy> deviceByIdentifier(XRDeviceIdentifier);

Modified: trunk/Source/WebKit/WebProcess/cocoa/PlatformXRSystemProxy.mm (277412 => 277413)


--- trunk/Source/WebKit/WebProcess/cocoa/PlatformXRSystemProxy.mm	2021-05-13 00:17:44 UTC (rev 277412)
+++ trunk/Source/WebKit/WebProcess/cocoa/PlatformXRSystemProxy.mm	2021-05-13 00:21:32 UTC (rev 277413)
@@ -89,6 +89,11 @@
     return PlatformXRCoordinator::defaultLayerHandle();
 }
 
+void PlatformXRSystemProxy::submitFrame()
+{
+    m_page.send(Messages::PlatformXRSystem::SubmitFrame());
+}
+
 void PlatformXRSystemProxy::sessionDidEnd(XRDeviceIdentifier deviceIdentifier)
 {
     if (auto device = deviceByIdentifier(deviceIdentifier))
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to