Initial support for fixed position elements in Qt WebKit2
authoryael.aharon@nokia.com <yael.aharon@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Apr 2012 23:40:51 +0000 (23:40 +0000)
committeryael.aharon@nokia.com <yael.aharon@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Apr 2012 23:40:51 +0000 (23:40 +0000)
commit8cc8d1d08c0db35cbe428d266005b34aeae6b10b
treeb52f6c51875a38357fb3d9bb7c4d26ec01fe4d18
parent5d89408c0c5c173afd7ddf6f3db5c055575b69fc
Initial support for fixed position elements in Qt WebKit2
https://bugs.webkit.org/show_bug.cgi?id=81786

Reviewed by Noam Rosenthal.

.:

* ManualTests/fixed-position.html: Added.

Source/WebCore:

When the setting acceleratedCompositingForFixedPositionEnabled is true, we update
the position of fixed layers, and send updates to the UI process as we scroll.
Before painting, TextureMapperLayer receives a delta of the scroll positions between the UI
and the web processes, and adjusts its transform position accordingly.

* page/FrameView.cpp:
(WebCore::FrameView::setFixedVisibleContentRect):
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::setScrollPositionDelta):
(WebCore):
* platform/graphics/texmap/TextureMapperLayer.h:
(TextureMapperLayer):

Source/WebKit2:

Turn on the flag acceleratedCompositingForFixedPositionEnabled when using fixed layout.
As we scroll, we keep track of the delta in scroll position between the UI and web processes,
and adjust the position of all the fixed layers by that delta.
When WebLayerTreeRenderer receives a new scroll position from the web process, it keeps it as pending,
and commit the new scroll position in flushLayerChanges.
This patch does not address scrolling overshoot and it does not fix the wrong positioning
that occurs when we zoom. These issues will be addressed in future patches.

* Shared/WebLayerTreeInfo.h:
* UIProcess/API/qt/qquickwebpage.cpp:
(QQuickWebPagePrivate::updateSize):
* UIProcess/LayerTreeHostProxy.cpp:
(WebKit::LayerTreeHostProxy::setContentsSize):
(WebKit):
(WebKit::LayerTreeHostProxy::renderNextFrame):
(WebKit::LayerTreeHostProxy::didChangeScrollPosition):
* UIProcess/LayerTreeHostProxy.h:
(LayerTreeHostProxy):
* UIProcess/LayerTreeHostProxy.messages.in:
* UIProcess/WebLayerTreeRenderer.cpp:
(WebKit::boundedScrollPosition):
(WebKit):
(WebKit::WebLayerTreeRenderer::paintToCurrentGLContext):
(WebKit::WebLayerTreeRenderer::setContentsSize):
(WebKit::WebLayerTreeRenderer::adjustPositionForFixedLayers):
(WebKit::WebLayerTreeRenderer::didChangeScrollPosition):
(WebKit::WebLayerTreeRenderer::syncLayerParameters):
(WebKit::WebLayerTreeRenderer::deleteLayer):
(WebKit::WebLayerTreeRenderer::flushLayerChanges):
* UIProcess/WebLayerTreeRenderer.h:
(WebLayerTreeRenderer):
* WebProcess/WebCoreSupport/WebGraphicsLayer.cpp:
(WebCore::WebGraphicsLayer::WebGraphicsLayer):
(WebCore::WebGraphicsLayer::syncCompositingState):
(WebCore::WebGraphicsLayer::syncCompositingStateForThisLayerOnly):
* WebProcess/WebCoreSupport/WebGraphicsLayer.h:
(WebGraphicsLayerClient):
(WebCore::WebGraphicsLayer::fixedToViewport):
(WebCore::WebGraphicsLayer::setFixedToViewport):
(WebGraphicsLayer):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setResizesToContentsUsingLayoutSize):
* WebProcess/WebPage/qt/LayerTreeHostQt.cpp:
(WebKit::LayerTreeHostQt::LayerTreeHostQt):
(WebKit::LayerTreeHostQt::didSyncCompositingStateForLayer):
(WebKit::updateOffsetFromViewportForSelf):
(WebKit):
(WebKit::updateOffsetFromViewportForLayer):
(WebKit::LayerTreeHostQt::syncFixedLayers):
(WebKit::LayerTreeHostQt::setVisibleContentsRect):
* WebProcess/WebPage/qt/LayerTreeHostQt.h:
(LayerTreeHostQt):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@113791 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
ChangeLog
ManualTests/fixed-position.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/FrameView.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebLayerTreeInfo.h
Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp
Source/WebKit2/UIProcess/LayerTreeHostProxy.cpp
Source/WebKit2/UIProcess/LayerTreeHostProxy.h
Source/WebKit2/UIProcess/LayerTreeHostProxy.messages.in
Source/WebKit2/UIProcess/WebLayerTreeRenderer.cpp
Source/WebKit2/UIProcess/WebLayerTreeRenderer.h
Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp
Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.h