Title: [109094] trunk/Source/WebKit2
Revision
109094
Author
[email protected]
Date
2012-02-28 02:42:03 -0800 (Tue, 28 Feb 2012)

Log Message

[Qt][WK2] Use movementStarted/Ended signals instead of movingChanged on QtViewportInterationEngine
https://bugs.webkit.org/show_bug.cgi?id=79521

Patch by Hugo Parente Lima <[email protected]> on 2012-02-28
Reviewed by Kenneth Rohde Christiansen.

movingChanged() signal is emitted many times, so the use of movementStarted() and
movementEnded() is a better choice.

* UIProcess/qt/QtFlickProvider.cpp:
(QtFlickProvider::QtFlickProvider):
* UIProcess/qt/QtFlickProvider.h:
(QtFlickProvider):
* UIProcess/qt/QtViewportInteractionEngine.cpp:
(WebKit::QtViewportInteractionEngine::QtViewportInteractionEngine):
* UIProcess/qt/QtViewportInteractionEngine.h:
(QtViewportInteractionEngine):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (109093 => 109094)


--- trunk/Source/WebKit2/ChangeLog	2012-02-28 10:21:05 UTC (rev 109093)
+++ trunk/Source/WebKit2/ChangeLog	2012-02-28 10:42:03 UTC (rev 109094)
@@ -1,3 +1,22 @@
+2012-02-28  Hugo Parente Lima  <[email protected]>
+
+        [Qt][WK2] Use movementStarted/Ended signals instead of movingChanged on QtViewportInterationEngine
+        https://bugs.webkit.org/show_bug.cgi?id=79521
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        movingChanged() signal is emitted many times, so the use of movementStarted() and
+        movementEnded() is a better choice.
+
+        * UIProcess/qt/QtFlickProvider.cpp:
+        (QtFlickProvider::QtFlickProvider):
+        * UIProcess/qt/QtFlickProvider.h:
+        (QtFlickProvider):
+        * UIProcess/qt/QtViewportInteractionEngine.cpp:
+        (WebKit::QtViewportInteractionEngine::QtViewportInteractionEngine):
+        * UIProcess/qt/QtViewportInteractionEngine.h:
+        (QtViewportInteractionEngine):
+
 2012-02-27  Shinya Kawanaka  <[email protected]>
 
         Element::removeShadowRoot() and setShadowRoot() should be moved into ShadowTree.

Modified: trunk/Source/WebKit2/UIProcess/qt/QtFlickProvider.cpp (109093 => 109094)


--- trunk/Source/WebKit2/UIProcess/qt/QtFlickProvider.cpp	2012-02-28 10:21:05 UTC (rev 109093)
+++ trunk/Source/WebKit2/UIProcess/qt/QtFlickProvider.cpp	2012-02-28 10:42:03 UTC (rev 109094)
@@ -106,7 +106,8 @@
     pageItem->setParentItem(m_contentItem);
 
     // Propagate flickable signals.
-    connect(m_flickable, SIGNAL(movingChanged()), SIGNAL(movingChanged()), Qt::DirectConnection);
+    connect(m_flickable, SIGNAL(movementStarted()), SIGNAL(movementStarted()), Qt::DirectConnection);
+    connect(m_flickable, SIGNAL(movementEnded()), SIGNAL(movementEnded()), Qt::DirectConnection);
     connect(m_flickable, SIGNAL(flickingChanged()), SIGNAL(flickingChanged()), Qt::DirectConnection);
     connect(m_flickable, SIGNAL(draggingChanged()), SIGNAL(draggingChanged()), Qt::DirectConnection);
     connect(m_flickable, SIGNAL(contentWidthChanged()), SIGNAL(contentWidthChanged()), Qt::DirectConnection);

Modified: trunk/Source/WebKit2/UIProcess/qt/QtFlickProvider.h (109093 => 109094)


--- trunk/Source/WebKit2/UIProcess/qt/QtFlickProvider.h	2012-02-28 10:21:05 UTC (rev 109093)
+++ trunk/Source/WebKit2/UIProcess/qt/QtFlickProvider.h	2012-02-28 10:42:03 UTC (rev 109094)
@@ -72,7 +72,8 @@
     void contentHeightChanged();
     void contentXChanged();
     void contentYChanged();
-    void movingChanged();
+    void movementStarted();
+    void movementEnded();
     void flickingChanged();
     void draggingChanged();
 

Modified: trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp (109093 => 109094)


--- trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp	2012-02-28 10:21:05 UTC (rev 109093)
+++ trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp	2012-02-28 10:42:03 UTC (rev 109094)
@@ -125,7 +125,8 @@
 
     connect(m_content, SIGNAL(widthChanged()), SLOT(itemSizeChanged()), Qt::DirectConnection);
     connect(m_content, SIGNAL(heightChanged()), SLOT(itemSizeChanged()), Qt::DirectConnection);
-    connect(m_flickProvider, SIGNAL(movingChanged()), SLOT(flickableMovingStateChanged()), Qt::DirectConnection);
+    connect(m_flickProvider, SIGNAL(movementStarted()), SLOT(flickableMoveStarted()), Qt::DirectConnection);
+    connect(m_flickProvider, SIGNAL(movementEnded()), SLOT(flickableMoveEnded()), Qt::DirectConnection);
 
     connect(m_scaleAnimation, SIGNAL(valueChanged(QVariant)),
             SLOT(scaleAnimationValueChanged(QVariant)), Qt::DirectConnection);
@@ -187,18 +188,9 @@
     return true;
 }
 
-void QtViewportInteractionEngine::flickableMovingStateChanged()
+void QtViewportInteractionEngine::flickableMoveStarted()
 {
-    if (m_flickProvider->isMoving()) {
-        if (m_scrollUpdateDeferrer)
-            return; // We get the isMoving() signal multiple times.
-        panMoveStarted();
-    } else
-        panMoveEnded();
-}
-
-void QtViewportInteractionEngine::panMoveStarted()
-{
+    Q_ASSERT(m_flickProvider->isMoving());
     m_scrollUpdateDeferrer = adoptPtr(new ViewportUpdateDeferrer(this));
 
     m_lastScrollPosition = m_flickProvider->contentPos();
@@ -206,8 +198,9 @@
     connect(m_flickProvider, SIGNAL(contentYChanged()), SLOT(flickableMovingPositionUpdate()));
 }
 
-void QtViewportInteractionEngine::panMoveEnded()
+void QtViewportInteractionEngine::flickableMoveEnded()
 {
+    Q_ASSERT(!m_flickProvider->isMoving());
     // This method is called on the end of the pan or pan kinetic animation.
     m_scrollUpdateDeferrer.clear();
 

Modified: trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h (109093 => 109094)


--- trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h	2012-02-28 10:21:05 UTC (rev 109093)
+++ trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h	2012-02-28 10:42:03 UTC (rev 109094)
@@ -113,12 +113,14 @@
     // Respond to changes of content that are not driven by us, like the page resizing itself.
     void itemSizeChanged();
 
-    void flickableMovingStateChanged();
     void flickableMovingPositionUpdate();
 
     void scaleAnimationStateChanged(QAbstractAnimation::State, QAbstractAnimation::State);
     void scaleAnimationValueChanged(QVariant value) { setItemRectVisible(value.toRectF()); }
 
+    void flickableMoveStarted(); // Called when panning starts.
+    void flickableMoveEnded(); //   Called when panning (+ kinetic animation) ends.
+
 private:
     friend class ViewportUpdateDeferrer;
 
@@ -130,9 +132,6 @@
     qreal innerBoundedCSSScale(qreal);
     qreal outerBoundedCSSScale(qreal);
 
-    void panMoveStarted(); // Called when panning starts.
-    void panMoveEnded(); //   Called when panning (+ kinetic animation) ends.
-
     QRectF computePosRangeForItemAtScale(qreal itemScale) const;
     bool ensureContentWithinViewportBoundary(bool immediate = false);
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to