[Qt] Handle the layers visible rect calculation on the web process.
authorjocelyn.turcotte@nokia.com <jocelyn.turcotte@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Jan 2012 15:37:53 +0000 (15:37 +0000)
committerjocelyn.turcotte@nokia.com <jocelyn.turcotte@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Jan 2012 15:37:53 +0000 (15:37 +0000)
commitfc3b9d7d3e456c00c739d4cd05248f32a9b4bc19
tree93c1743761c0d214438cbecc3a122bcea2c3fc62
parent9884f5d59ea350f6b0446c3c74ed59b505db5460
[Qt] Handle the layers visible rect calculation on the web process.
https://bugs.webkit.org/show_bug.cgi?id=74720

Reviewed by Noam Rosenthal.

Source/WebCore:

Remove all visible rect calculation related code from TextureMapperNode.

* platform/graphics/texmap/TextureMapperNode.cpp:
* platform/graphics/texmap/TextureMapperNode.h:

Source/WebKit2:

The layers now get their visible rect on the web process through the
root layer when the UI process call setVisibleContentRectAndScale,
previously only used for the non-composited content layer.
The rect is then carried down the layers in the tree which apply it the inverse
of their transform before handing it to their tiled backing store.

This ensures that new layers get a proper visible rect right on creation,
and also that simultaneous visible rect and scale changes are applied synchronously.

This patch also uses clampedBoundsOfProjectedQuad instead of mapRect
to transform the visible rect correctly for 3D transformed layers.

* UIProcess/API/qt/qquickwebview.cpp:
(QQuickWebViewPrivate::initializeDesktop):
(QQuickWebViewPrivate::initializeTouch):
(QQuickWebViewPrivate::updateDesktopViewportSize):
(QQuickWebViewPrivate::updateTouchViewportSize):
(QQuickWebView::geometryChanged):
Make sure that the visible rect is updated for the desktop view as well.
* UIProcess/API/qt/qquickwebview_p_p.h:
* UIProcess/LayerTreeHostProxy.h:
* UIProcess/qt/LayerTreeHostProxyQt.cpp:
(WebKit::LayerTreeHostProxy::paintToCurrentGLContext):
* WebProcess/WebCoreSupport/WebGraphicsLayer.cpp:
(WebCore::WebGraphicsLayer::setChildren):
(WebCore::WebGraphicsLayer::addChild):
(WebCore::WebGraphicsLayer::addChildAtIndex):
(WebCore::WebGraphicsLayer::addChildAbove):
(WebCore::WebGraphicsLayer::addChildBelow):
(WebCore::WebGraphicsLayer::replaceChild):
(WebCore::WebGraphicsLayer::setMaskLayer):
(WebCore::WebGraphicsLayer::syncCompositingState):
(WebCore::WebGraphicsLayer::syncCompositingStateForThisLayerOnly):
(WebCore::WebGraphicsLayer::setVisibleContentRectAndScale):
(WebCore::WebGraphicsLayer::tiledBackingStoreVisibleRect):
(WebCore::WebGraphicsLayer::computeTransformedVisibleRect):
* WebProcess/WebCoreSupport/WebGraphicsLayer.h:
* WebProcess/WebPage/LayerTreeHost.messages.in:
* WebProcess/WebPage/qt/LayerTreeHostQt.cpp:
(WebKit::LayerTreeHostQt::setVisibleContentRectAndScale):
* WebProcess/WebPage/qt/LayerTreeHostQt.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105413 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperNode.h
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h
Source/WebKit2/UIProcess/LayerTreeHostProxy.h
Source/WebKit2/UIProcess/qt/LayerTreeHostProxyQt.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.h
Source/WebKit2/WebProcess/WebPage/LayerTreeHost.messages.in
Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp
Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.h