Skip to content
  • commit-queue@webkit.org's avatar
    [CoordGfx] requestAnimationFrame performance issues · 984d32f9
    commit-queue@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=112345
    
    Patch by Noam Rosenthal <noam@webkit.org> on 2013-05-13
    Reviewed by Jocelyn Turcotte.
    
    Source/WebCore:
    
    Removed current requestAnimationFrame logic from CoordinatedGraphics. The new logic
    is entirely in WebKit2 CoordinatedLayerTreeHost.
    
    Covered by existing tests in fast/animations.
    
    * platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp:
    (WebCore::CoordinatedGraphicsScene::CoordinatedGraphicsScene):
    (WebCore::CoordinatedGraphicsScene::paintToCurrentGLContext):
    * platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h:
    (CoordinatedGraphicsScene):
    
    Source/WebKit2:
    
    Changed the logic of requestAnimationFrame in Coordinated Graphics.
    We don't send any IPC messages for requestAnimationFrame. Instead, we do one of two things:
    - If there is already a frame pending in the UI process, do nothing, as the animations would
      be serviced when the frame is returned to the web process.
    - If there is no frame pending, we schedule a flush, making sure that that flush occurs at
      least 1/60 seconds after the last animation service, so that we don't get an infinite loop
      of flushes.
    
    * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp:
    (WebKit::CoordinatedLayerTreeHostProxy::requestAnimationFrame):
    * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h:
    * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
    (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
    (WebKit::CoordinatedLayerTreeHost::flushPendingLayerChanges):
    (WebKit::CoordinatedLayerTreeHost::scheduleAnimation):
    * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
    * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.messages.in:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150015 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    984d32f9