Ensure tiles are repainted when scrolling using mouse wheel.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Jan 2012 17:09:13 +0000 (17:09 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Jan 2012 17:09:13 +0000 (17:09 +0000)
https://bugs.webkit.org/show_bug.cgi?id=77339

A new slot visibleContentRectAndScaleChanged has been added
that is emited by non-animated scrolling code in the
QtViewportInteractionEngine.

Patch by Allan Sandfeld Jensen <allan.jensen@nokia.com> on 2012-01-31
Reviewed by Kenneth Rohde Christiansen.

* UIProcess/API/qt/qquickwebview.cpp:
(QQuickWebViewPrivate::initializeDesktop):
(QQuickWebViewPrivate::initializeTouch):
(QQuickWebViewPrivate::_q_resume):
(QQuickWebViewPrivate::_q_updateVisibleContentRectAndScale):
(QQuickWebViewPrivate::updateTouchViewportSize):
* UIProcess/API/qt/qquickwebview_p.h:
* UIProcess/API/qt/qquickwebview_p_p.h:
(QQuickWebViewPrivate):
* UIProcess/qt/QtViewportInteractionEngine.cpp:
(WebKit::QtViewportInteractionEngine::wheelEvent):
* UIProcess/qt/QtViewportInteractionEngine.h:
(QtViewportInteractionEngine):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106362 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h
Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h
Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp
Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h

index f303678..2dc3ea5 100644 (file)
@@ -1,3 +1,28 @@
+2012-01-31  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
+
+        Ensure tiles are repainted when scrolling using mouse wheel.
+        https://bugs.webkit.org/show_bug.cgi?id=77339
+
+        A new slot visibleContentRectAndScaleChanged has been added
+        that is emited by non-animated scrolling code in the
+        QtViewportInteractionEngine.
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        * UIProcess/API/qt/qquickwebview.cpp:
+        (QQuickWebViewPrivate::initializeDesktop):
+        (QQuickWebViewPrivate::initializeTouch):
+        (QQuickWebViewPrivate::_q_resume):
+        (QQuickWebViewPrivate::_q_updateVisibleContentRectAndScale):
+        (QQuickWebViewPrivate::updateTouchViewportSize):
+        * UIProcess/API/qt/qquickwebview_p.h:
+        * UIProcess/API/qt/qquickwebview_p_p.h:
+        (QQuickWebViewPrivate):
+        * UIProcess/qt/QtViewportInteractionEngine.cpp:
+        (WebKit::QtViewportInteractionEngine::wheelEvent):
+        * UIProcess/qt/QtViewportInteractionEngine.h:
+        (QtViewportInteractionEngine):
+
 2012-01-31  Zeno Albisser  <zeno@webkit.org>
 
         [Qt][WK2] Make UIProcess decide about encoding of input data for application URL schemes.
index af818fa..5712ca5 100644 (file)
@@ -137,6 +137,7 @@ void QQuickWebViewPrivate::initializeDesktop(QQuickWebView* viewport)
         QObject::disconnect(interactionEngine.data(), SIGNAL(contentSuspendRequested()), viewport, SLOT(_q_suspend()));
         QObject::disconnect(interactionEngine.data(), SIGNAL(contentResumeRequested()), viewport, SLOT(_q_resume()));
         QObject::disconnect(interactionEngine.data(), SIGNAL(viewportTrajectoryVectorChanged(const QPointF&)), viewport, SLOT(_q_viewportTrajectoryVectorChanged(const QPointF&)));
+        QObject::disconnect(interactionEngine.data(), SIGNAL(visibleContentRectAndScaleChanged()), viewport, SLOT(_q_updateVisibleContentRectAndScale()));
     }
     interactionEngine.reset(0);
     pageView->d->eventHandler->setViewportInteractionEngine(0);
@@ -152,6 +153,7 @@ void QQuickWebViewPrivate::initializeTouch(QQuickWebView* viewport)
     QObject::connect(interactionEngine.data(), SIGNAL(contentSuspendRequested()), viewport, SLOT(_q_suspend()));
     QObject::connect(interactionEngine.data(), SIGNAL(contentResumeRequested()), viewport, SLOT(_q_resume()));
     QObject::connect(interactionEngine.data(), SIGNAL(viewportTrajectoryVectorChanged(const QPointF&)), viewport, SLOT(_q_viewportTrajectoryVectorChanged(const QPointF&)));
+    QObject::connect(interactionEngine.data(), SIGNAL(visibleContentRectAndScaleChanged()), viewport, SLOT(_q_updateVisibleContentRectAndScale()));
     updateTouchViewportSize();
 }
 
@@ -214,7 +216,7 @@ void QQuickWebViewPrivate::_q_resume()
         postTransitionState->apply();
     }
 
-    updateVisibleContentRectAndScale();
+    _q_updateVisibleContentRectAndScale();
 }
 
 void QQuickWebViewPrivate::didChangeContentsSize(const QSize& newSize)
@@ -298,7 +300,7 @@ void QQuickWebViewPrivate::handleDownloadRequest(DownloadProxy* download)
     context->downloadManager()->addDownload(download, downloadItem);
 }
 
-void QQuickWebViewPrivate::updateVisibleContentRectAndScale()
+void QQuickWebViewPrivate::_q_updateVisibleContentRectAndScale()
 {
     DrawingAreaProxy* drawingArea = webPageProxy->drawingArea();
     if (!drawingArea)
@@ -365,7 +367,7 @@ void QQuickWebViewPrivate::updateTouchViewportSize()
     webPageProxy->setViewportSize(viewportSize);
 
     interactionEngine->applyConstraints(computeViewportConstraints());
-    updateVisibleContentRectAndScale();
+    _q_updateVisibleContentRectAndScale();
 }
 
 void QQuickWebViewPrivate::PostTransitionState::apply()
index cac38c7..7a713d1 100644 (file)
@@ -165,6 +165,7 @@ private:
     Q_PRIVATE_SLOT(d_func(), void _q_suspend());
     Q_PRIVATE_SLOT(d_func(), void _q_resume());
     Q_PRIVATE_SLOT(d_func(), void _q_viewportTrajectoryVectorChanged(const QPointF&));
+    Q_PRIVATE_SLOT(d_func(), void _q_updateVisibleContentRectAndScale());
     Q_PRIVATE_SLOT(d_func(), void _q_onOpenPanelFilesSelected());
     Q_PRIVATE_SLOT(d_func(), void _q_onOpenPanelFinished(int result));
     Q_PRIVATE_SLOT(d_func(), void _q_onVisibleChanged());
index 9f28170..17a5cf8 100644 (file)
@@ -83,7 +83,7 @@ public:
     void updateTouchViewportSize();
     QtViewportInteractionEngine::Constraints computeViewportConstraints();
 
-    void updateVisibleContentRectAndScale();
+    void _q_updateVisibleContentRectAndScale();
 
     void _q_suspend();
     void _q_resume();
index 87cb9db..d2eb156 100644 (file)
@@ -305,6 +305,8 @@ void QtViewportInteractionEngine::wheelEvent(QWheelEvent* ev)
 
     QRectF endPosRange = computePosRangeForItemAtScale(m_content->contentScale());
     m_content->setPos(-boundPosition(endPosRange.topLeft(), newPos, endPosRange.bottomRight()));
+
+    emit visibleContentRectAndScaleChanged();
 }
 
 void QtViewportInteractionEngine::pagePositionRequest(const QPoint& pagePosition)
index 1790c72..a4b6990 100644 (file)
@@ -106,6 +106,7 @@ Q_SIGNALS:
     void contentResumeRequested();
 
     void viewportTrajectoryVectorChanged(const QPointF&);
+    void visibleContentRectAndScaleChanged();
 
 private Q_SLOTS:
     // Respond to changes of content that are not driven by us, like the page resizing itself.