Title: [286023] trunk/Source/WebKit
Revision
286023
Author
[email protected]
Date
2021-11-18 12:58:02 -0800 (Thu, 18 Nov 2021)

Log Message

[Model] add support for getting and setting the camera
https://bugs.webkit.org/show_bug.cgi?id=233265
<rdar://problem/85426290>

Unreviewed build fix.

Fix the Montery build, making sure we guard calls to the new ARQL SPIs.

* UIProcess/Cocoa/ModelElementControllerCocoa.mm:
(WebKit::ModelElementController::getCameraForModelElement):
(WebKit::ModelElementController::setCameraForModelElement):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (286022 => 286023)


--- trunk/Source/WebKit/ChangeLog	2021-11-18 20:54:55 UTC (rev 286022)
+++ trunk/Source/WebKit/ChangeLog	2021-11-18 20:58:02 UTC (rev 286023)
@@ -1,3 +1,17 @@
+2021-11-18  Antoine Quint  <[email protected]>
+
+        [Model] add support for getting and setting the camera
+        https://bugs.webkit.org/show_bug.cgi?id=233265
+        <rdar://problem/85426290>
+
+        Unreviewed build fix.
+
+        Fix the Montery build, making sure we guard calls to the new ARQL SPIs.
+
+        * UIProcess/Cocoa/ModelElementControllerCocoa.mm:
+        (WebKit::ModelElementController::getCameraForModelElement):
+        (WebKit::ModelElementController::setCameraForModelElement):
+
 2021-11-18  Per Arne  <[email protected]>
 
         [iOS] Block access to unused resources in the Networking process' sandbox

Modified: trunk/Source/WebKit/UIProcess/Cocoa/ModelElementControllerCocoa.mm (286022 => 286023)


--- trunk/Source/WebKit/UIProcess/Cocoa/ModelElementControllerCocoa.mm	2021-11-18 20:54:55 UTC (rev 286022)
+++ trunk/Source/WebKit/UIProcess/Cocoa/ModelElementControllerCocoa.mm	2021-11-18 20:58:02 UTC (rev 286023)
@@ -253,6 +253,7 @@
         return;
     }
 
+#if ENABLE(ARKIT_INLINE_PREVIEW_CAMERA_TRANSFORM)
     [preview getCameraTransform:makeBlockPtr([weakThis = WeakPtr { *this }, completionHandler = WTFMove(completionHandler)] (simd_float3 cameraTransform, NSError *error) mutable {
         if (error) {
             callOnMainRunLoop([weakThis = WTFMove(weakThis), completionHandler = WTFMove(completionHandler), error = WebCore::ResourceError { WebCore::ResourceError::Type::General }] () mutable {
@@ -267,6 +268,13 @@
                 completionHandler(WebCore::HTMLModelElementCamera { cameraTransform.x, cameraTransform.y, cameraTransform.z });
         });
     }).get()];
+#else
+    callOnMainRunLoop([weakThis = WeakPtr { *this }, completionHandler = WTFMove(completionHandler), error = WebCore::ResourceError { WebCore::ResourceError::Type::General }] () mutable {
+        if (weakThis)
+            completionHandler(makeUnexpected(error));
+    });
+    return;
+#endif
 }
 
 void ModelElementController::setCameraForModelElement(ModelIdentifier modelIdentifier, WebCore::HTMLModelElementCamera camera, CompletionHandler<void(bool)>&& completionHandler)
@@ -280,11 +288,17 @@
         return;
     }
 
+#if ENABLE(ARKIT_INLINE_PREVIEW_CAMERA_TRANSFORM)
     [preview setCameraTransform:simd_make_float3(camera.pitch, camera.yaw, camera.scale)];
+#endif
 
     callOnMainRunLoop([weakThis = WeakPtr { *this }, completionHandler = WTFMove(completionHandler)] () mutable {
         if (weakThis)
+#if ENABLE(ARKIT_INLINE_PREVIEW_CAMERA_TRANSFORM)
             completionHandler(true);
+#else
+            completionHandler(false);
+#endif
     });
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to