Skip to content
  • zeno.albisser@nokia.com's avatar
    [Qt] requestAnimationFrame should only trigger when a new frame can be displayed. · 4eb2c58e
    zeno.albisser@nokia.com authored
    https://bugs.webkit.org/show_bug.cgi?id=88638
    
    Source/WebKit/qt:
    
    Disable REQUEST_ANIMATION_FRAME_TIMER for the Qt port and tie
    the servicing of scripted animations to the renderNextFrame call for WK2.
    For WK1 we rely on the RefreshAnimation that is based on QAbstractAnimation.
    
    Reviewed by Jocelyn Turcotte.
    
    * WebCoreSupport/ChromeClientQt.cpp:
    (RefreshAnimation):
        Add a RefreshAnimation that is based on QAbstractAnimation
        and drives the servicing of the scripted animations for WK1.
    (WebCore::RefreshAnimation::RefreshAnimation):
    (WebCore::RefreshAnimation::duration):
    (WebCore::RefreshAnimation::scheduleAnimation):
        Set m_animationScheduled to true and start the animation
        timer in case it is not running yet.
    (WebCore::RefreshAnimation::updateCurrentTime):
        Call serviceScriptedAnimations if m_animationScheduled is true.
        If this is not the case, the animation timer can be stopped,
        because no animation needs to be scheduled anymore.
    (WebCore):
    (WebCore::ChromeClientQt::scheduleAnimation):
        Create and start the RefreshAnimation instance with the
        first call to scheduleAnimation.
    * WebCoreSupport/ChromeClientQt.h:
    (WebCore):
    (ChromeClientQt):
    
    Source/WebKit2:
    
    Disable REQUEST_ANIMATION_FRAME_TIMER for the Qt port and tie
    the servicing of scripted animations to layer syncing for WK2.
    For WK1 we rely on the RefreshAnimation that is based on QAbstractAnimation.
    
    Reviewed by Jocelyn Turcotte.
    
    * WebProcess/WebCoreSupport/WebChromeClient.cpp:
    (WebKit):
    (WebKit::WebChromeClient::scheduleAnimation):
    * WebProcess/WebCoreSupport/WebChromeClient.h:
    (WebChromeClient):
    * WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.cpp:
    (WebKit::LayerTreeCoordinator::performScheduledLayerFlush):
    (WebKit::LayerTreeCoordinator::scheduleAnimation):
    (WebKit):
    * WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.h:
    (LayerTreeCoordinator):
    * WebProcess/WebPage/LayerTreeHost.h:
    (LayerTreeHost):
    
    Source/WTF:
    
    Disable REQUEST_ANIMATION_FRAME_TIMER for the Qt port and tie
    the servicing of scripted animations to layer syncing for WK2.
    For WK1 we rely on the RefreshAnimation that is based on QAbstractAnimation.
    
    Reviewed by Jocelyn Turcotte.
    
    * wtf/Platform.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123786 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    4eb2c58e