Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4c5b5ac8528c78a1eb89748a773b365b4a4d9899
      
https://github.com/WebKit/WebKit/commit/4c5b5ac8528c78a1eb89748a773b365b4a4d9899
  Author: Ada Chan <[email protected]>
  Date:   2025-05-05 (Mon, 05 May 2025)

  Changed paths:
    M Source/WebCore/Modules/model-element/ModelPlayer.cpp
    M Source/WebCore/Modules/model-element/ModelPlayer.h
    A Source/WebCore/Modules/model-element/ModelPlayerAnimationState.cpp
    A Source/WebCore/Modules/model-element/ModelPlayerAnimationState.h
    M Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp
    M Source/WebCore/Modules/websockets/WebSocketExtensionParser.cpp
    M Source/WebCore/Sources.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebKit/WebProcess/Model/ModelProcessModelPlayer.cpp
    M Source/WebKit/WebProcess/Model/ModelProcessModelPlayer.h

  Log Message:
  -----------
  Refactor the model animation state tracking logic into another class
https://bugs.webkit.org/show_bug.cgi?id=292499
rdar://150608558

Reviewed by Mike Wyrzykowski.

ModelPlayerAnimationState tracks all animation related properties
in the model player. It also has the logic to interpolate the
animation's current time based on the last cached current time along
with the clock timestamp. The code is copied from ModelProcessModelPlayer,
and ModelProcessModelPlayer has been updated to use ModelPlayerAnimationState.

Add a method in ModelPlayer for getting the current animation state.
This will be used in a later patch for restoring the ModelPlayer
state after reload.

* Source/WebCore/Modules/model-element/ModelPlayer.cpp:
(WebCore::ModelPlayer::currentAnimationState const):
* Source/WebCore/Modules/model-element/ModelPlayer.h:
* Source/WebCore/Modules/model-element/ModelPlayerAnimationState.cpp: Added.
(WebCore::ModelPlayerAnimationState::ModelPlayerAnimationState):
(WebCore::ModelPlayerAnimationState::autoplay const):
(WebCore::ModelPlayerAnimationState::setAutoplay):
(WebCore::ModelPlayerAnimationState::loop const):
(WebCore::ModelPlayerAnimationState::setLoop):
(WebCore::ModelPlayerAnimationState::paused const):
(WebCore::ModelPlayerAnimationState::setPaused):
(WebCore::ModelPlayerAnimationState::duration const):
(WebCore::ModelPlayerAnimationState::setDuration):
(WebCore::ModelPlayerAnimationState::effectivePlaybackRate const):
(WebCore::ModelPlayerAnimationState::setPlaybackRate):
(WebCore::ModelPlayerAnimationState::lastCachedCurrentTime const):
(WebCore::ModelPlayerAnimationState::lastCachedClockTimestamp const):
(WebCore::ModelPlayerAnimationState::currentTime const):
(WebCore::ModelPlayerAnimationState::setCurrentTime):
* Source/WebCore/Modules/model-element/ModelPlayerAnimationState.h: Added.
* Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp:
Fix compile error after adding ModelPlayerAnimationState.cpp to Sources.txt
* Source/WebCore/Modules/websockets/WebSocketExtensionParser.cpp:
(WebCore::isSeparator):
Ditto
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebKit/WebProcess/Model/ModelProcessModelPlayer.cpp:
(WebKit::ModelProcessModelPlayer::didUpdateAnimationPlaybackState):
(WebKit::ModelProcessModelPlayer::currentAnimationState const):
(WebKit::ModelProcessModelPlayer::setAutoplay):
(WebKit::ModelProcessModelPlayer::setLoop):
(WebKit::ModelProcessModelPlayer::duration const):
(WebKit::ModelProcessModelPlayer::paused const):
(WebKit::ModelProcessModelPlayer::currentTime const):
(WebKit::ModelProcessModelPlayer::setCurrentTime):
* Source/WebKit/WebProcess/Model/ModelProcessModelPlayer.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to