[webkit-changes] [WebKit/WebKit] 0a89da: Create a driver to update StageMode Interactions b...

Phipson noreply at github.com
Thu Feb 27 14:12:38 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0a89daa335939130198597b18646c556f00e2abb
      https://github.com/WebKit/WebKit/commit/0a89daa335939130198597b18646c556f00e2abb
  Author: Phipson Lee <phipsonleecy at gmail.com>
  Date:   2025-02-27 (Thu, 27 Feb 2025)

  Changed paths:
    M Source/WebKit/ModelProcess/cocoa/ModelProcessModelPlayerProxy.h
    M Source/WebKit/ModelProcess/cocoa/ModelProcessModelPlayerProxy.mm
    M Source/WebKit/UIProcess/Cocoa/WebKitSwiftSoftLink.h
    M Source/WebKit/UIProcess/Cocoa/WebKitSwiftSoftLink.mm
    M Source/WebKit/WebKit.xcodeproj/project.pbxproj
    M Source/WebKit/WebKitSwift/RealityKit/RKEntity.swift
    M Source/WebKit/WebKitSwift/RealityKit/RealityKitBridging.h
    A Source/WebKit/WebKitSwift/StageMode/WKStageMode.h
    A Source/WebKit/WebKitSwift/StageMode/WKStageMode.swift
    M Source/WebKit/WebKitSwift/WebKitSwift.h

  Log Message:
  -----------
  Create a driver to update StageMode Interactions based on Gesture Input
https://bugs.webkit.org/show_bug.cgi?id=287820
rdar://145006262

Reviewed by Richard Robinson, Elliott Williams, and Wenson Hsieh.

This PR adds the StageModeInteractionDriver, which is a helper class object used in the ModelProcessModelPlayerProxy
to control how the model responds to the stagemode transform updates, based on the applied stagemode attribute. When
stagemode is set to 'none' we ignore all transforms passed to the player proxy. When stagemode is set to 'orbit' we
use the translation from the transform to rotate the model. To separate stagemode updates from Javascript updates,
we introduce an Interaction Container that wraps around the model entity, on which the stagemode updates will be applied.

The driver will be implemented in https://bugs.webkit.org/show_bug.cgi?id=287601.

* Source/WebKit/ModelProcess/cocoa/ModelProcessModelPlayerProxy.h:
* Source/WebKit/ModelProcess/cocoa/ModelProcessModelPlayerProxy.mm:
(WebKit::ModelProcessModelPlayerProxy::didFinishLoading):
(WebKit::ModelProcessModelPlayerProxy::beginStageModeTransform):
(WebKit::ModelProcessModelPlayerProxy::updateStageModeTransform):
(WebKit::ModelProcessModelPlayerProxy::endStageModeInteraction):
(WebKit::ModelProcessModelPlayerProxy::setStageMode):
(WebKit::ModelProcessModelPlayerProxy::applyStageModeOperationToDriver):
- Updates the callbacks to use the interaction driver
- Also adds helper function to update the driver's internal state based on the stagemode attribute

* Source/WebKit/UIProcess/Cocoa/WebKitSwiftSoftLink.h:
* Source/WebKit/UIProcess/Cocoa/WebKitSwiftSoftLink.mm:
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Source/WebKit/WebKitSwift/StageMode/WKStageMode.swift: Added.
(WKStageModeInteractionDriver.stageModeOperation):
(WKStageModeInteractionDriver.interactionDidBegin(_:)):
(WKStageModeInteractionDriver.interactionDidUpdate(_:)):
(WKStageModeInteractionDriver.interactionDidEnd):
(WKStageModeInteractionDriver.operationDidChange(_:)):
- Adds the necessary APIs to apply the transform to the interaction target.

* Source/WebKit/WebKitSwift/StageMode/WKStageModeBridging.h: Copied from Source/WebKit/WebKitSwift/WebKitSwift.h.
* Source/WebKit/WebKitSwift/WebKitSwift.h:

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



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


More information about the webkit-changes mailing list