Accelerated overflow scrolling for Coordinated Graphics.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Mar 2013 12:07:26 +0000 (12:07 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Mar 2013 12:07:26 +0000 (12:07 +0000)
commit24162520575e225d1f494b2714883b769bf0dee7
tree41600b9e8cff2ee87e70aa2a0bdf227d335027df
parentaee4335bf5af705d6215bd0427e406146a317b51
Accelerated overflow scrolling for Coordinated Graphics.
https://bugs.webkit.org/show_bug.cgi?id=110323

Source/WebCore:

Patch by Luiz Agostini <luiz.agostini@nokia.com> on 2013-03-06
Reviewed by Noam Rosenthal.

A scroll offset is applied to individual layers on UI process and the
web process is notified assynchronously.
The new API WKCoordinatedScene may be used to scroll layers in the UI process.

Tests will be added on bug #111140.

Scrolling coordinator is used to provide a ScrollableArea to CoordinatedGraphicsLayer.

* page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
(WebCore::ScrollingCoordinatorCoordinatedGraphics::scrollableAreaScrollLayerDidChange):
(WebCore):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::willDestroyScrollableArea):
* page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h:
(ScrollingCoordinatorCoordinatedGraphics):

GraphicsLayerTextureMapper is responsible for receiving the 'did commit' messages and to pass
them to its TextureMapperLayer on the appropriated time.

* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::GraphicsLayerTextureMapper):
(WebCore::GraphicsLayerTextureMapper::didCommitScrollOffset):
(WebCore):
(WebCore::GraphicsLayerTextureMapper::setIsScrollable):
(WebCore::GraphicsLayerTextureMapper::commitLayerChanges):
* platform/graphics/texmap/GraphicsLayerTextureMapper.h:
(WebCore::GraphicsLayerTextureMapper::setScrollClient):
(WebCore::GraphicsLayerTextureMapper::setID):
(GraphicsLayerTextureMapper):
(WebCore::GraphicsLayerTextureMapper::isScrollable):

TextureMapperLayer is responsible for applying the requested scroll offset and for
sending the commit messages to web process. It is also able to hittest layers and identify
the ones that are scrollable.

* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::hitTest):
(WebCore):
(WebCore::TextureMapperLayer::scrollableLayerHitTestCondition):
(WebCore::TextureMapperLayer::findScrollableContentsLayerAt):
(WebCore::TextureMapperLayer::mapScrollOffset):
(WebCore::TextureMapperLayer::commitScrollOffset):
(WebCore::TextureMapperLayer::scrollBy):
(WebCore::TextureMapperLayer::didCommitScrollOffset):
* platform/graphics/texmap/TextureMapperLayer.h:
(TextureMapperLayer):
(ScrollingClient):
(WebCore::TextureMapperLayer::TextureMapperLayer):
(WebCore::TextureMapperLayer::setID):
(WebCore::TextureMapperLayer::id):
(WebCore::TextureMapperLayer::setScrollClient):
(WebCore::TextureMapperLayer::setIsScrollable):
(WebCore::TextureMapperLayer::isScrollable):
(WebCore::TextureMapperLayer::adjustedPosition):

CoordinatedGraphicsLayer receives the commit messages and updates its ScrollableArea.

* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
(WebCore::CoordinatedGraphicsLayer::setScrollableArea):
(WebCore):
(WebCore::CoordinatedGraphicsLayer::commitScrollOffset):
(WebCore::CoordinatedGraphicsLayer::resetLayerState):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
(WebCore):
(CoordinatedGraphicsLayer):
(WebCore::CoordinatedGraphicsLayer::isScrollable):

CoordinatedGraphicsScene receives the commit messages from TextureMapperLayer and
dispatches them on the main thread. It also has a new method that is used to find
the topmost scrollable layer at a given point.

* platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp:
(WebCore::CoordinatedGraphicsScene::setLayerState):
(WebCore::CoordinatedGraphicsScene::createLayer):
(WebCore::CoordinatedGraphicsScene::dispatchCommitScrollOffset):
(WebCore):
(WebCore::CoordinatedGraphicsScene::commitScrollOffset):
(WebCore::CoordinatedGraphicsScene::findScrollableContentsLayerAt):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h:
(WebCore):
(CoordinatedGraphicsSceneClient):
(CoordinatedGraphicsScene):

New fields have been added to CoordinatedGraphicsLayerState.

* platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
(CoordinatedGraphicsLayerState):

Source/WebKit2:

Patch by Luiz Agostini <luiz.agostini@nokia.com> on 2013-03-06
Reviewed by Noam Rosenthal.
Signed off for WebKit2 by Simon Fraser.

A scroll offset is applied to individual layers on UI process and the
web process is notified assynchronously.
The new API WKCoordinatedScene may be used to scroll layers in the UI process.

* CMakeLists.txt:

Encoding and decoding the new members of CoordinatedGraphicsLayerState.

* Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
(CoreIPC::::encode):
(CoreIPC::::decode):

Adding acceleratedCompositingForOverflowScrollEnabled to WebPreferencesStore.

* Shared/WebPreferencesStore.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

New API WKCoordinatedScene is used to scroll layers on UI side.

* UIProcess/API/CoordinatedGraphics/WKCoordinatedScene.cpp:
* UIProcess/API/CoordinatedGraphics/WKCoordinatedScene.h:
* UIProcess/CoordinatedGraphics/WKCoordinatedSceneAPICast.h:

A new message is used to send scroll commit messages to web process.

* UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp:
(WebKit::CoordinatedLayerTreeHostProxy::commitScrollOffset):
(WebKit):
* UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h:
(CoordinatedLayerTreeHostProxy):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::~CoordinatedLayerTreeHost):
(WebKit::CoordinatedLayerTreeHost::detachLayer):
(WebKit::CoordinatedLayerTreeHost::createGraphicsLayer):
(WebKit::CoordinatedLayerTreeHost::setVisibleContentsRect):
(WebKit::CoordinatedLayerTreeHost::purgeBackingStores):
(WebKit::CoordinatedLayerTreeHost::commitScrollOffset):
(WebKit):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
(CoordinatedLayerTreeHost):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.messages.in:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@144907 268f45cc-cd09-0410-ab3c-d52691b4dbfc
25 files changed:
Source/WebCore/ChangeLog
Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp
Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h
Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h
Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h
Source/WebKit2/CMakeLists.txt
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp
Source/WebKit2/Shared/WebPreferencesStore.h
Source/WebKit2/UIProcess/API/CoordinatedGraphics/WKCoordinatedScene.cpp [new file with mode: 0644]
Source/WebKit2/UIProcess/API/CoordinatedGraphics/WKCoordinatedScene.h [new file with mode: 0644]
Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp
Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h
Source/WebKit2/UIProcess/CoordinatedGraphics/WKCoordinatedSceneAPICast.h [new file with mode: 0644]
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.messages.in
Source/WebKit2/WebProcess/WebPage/WebPage.cpp