Changeset 109094 in webkit


Ignore:
Timestamp:
Feb 28, 2012 2:42:03 AM (12 years ago)
Author:
commit-queue@webkit.org
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 <Hugo Parente Lima> 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):

Location:
trunk/Source/WebKit2
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r109084 r109094  
     12012-02-28  Hugo Parente Lima  <hugo.lima@openbossa.org>
     2
     3        [Qt][WK2] Use movementStarted/Ended signals instead of movingChanged on QtViewportInterationEngine
     4        https://bugs.webkit.org/show_bug.cgi?id=79521
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        movingChanged() signal is emitted many times, so the use of movementStarted() and
     9        movementEnded() is a better choice.
     10
     11        * UIProcess/qt/QtFlickProvider.cpp:
     12        (QtFlickProvider::QtFlickProvider):
     13        * UIProcess/qt/QtFlickProvider.h:
     14        (QtFlickProvider):
     15        * UIProcess/qt/QtViewportInteractionEngine.cpp:
     16        (WebKit::QtViewportInteractionEngine::QtViewportInteractionEngine):
     17        * UIProcess/qt/QtViewportInteractionEngine.h:
     18        (QtViewportInteractionEngine):
     19
    1202012-02-27  Shinya Kawanaka  <shinyak@chromium.org>
    221
  • trunk/Source/WebKit2/UIProcess/qt/QtFlickProvider.cpp

    r107232 r109094  
    107107
    108108    // Propagate flickable signals.
    109     connect(m_flickable, SIGNAL(movingChanged()), SIGNAL(movingChanged()), Qt::DirectConnection);
     109    connect(m_flickable, SIGNAL(movementStarted()), SIGNAL(movementStarted()), Qt::DirectConnection);
     110    connect(m_flickable, SIGNAL(movementEnded()), SIGNAL(movementEnded()), Qt::DirectConnection);
    110111    connect(m_flickable, SIGNAL(flickingChanged()), SIGNAL(flickingChanged()), Qt::DirectConnection);
    111112    connect(m_flickable, SIGNAL(draggingChanged()), SIGNAL(draggingChanged()), Qt::DirectConnection);
  • trunk/Source/WebKit2/UIProcess/qt/QtFlickProvider.h

    r107232 r109094  
    7373    void contentXChanged();
    7474    void contentYChanged();
    75     void movingChanged();
     75    void movementStarted();
     76    void movementEnded();
    7677    void flickingChanged();
    7778    void draggingChanged();
  • trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp

    r108771 r109094  
    126126    connect(m_content, SIGNAL(widthChanged()), SLOT(itemSizeChanged()), Qt::DirectConnection);
    127127    connect(m_content, SIGNAL(heightChanged()), SLOT(itemSizeChanged()), Qt::DirectConnection);
    128     connect(m_flickProvider, SIGNAL(movingChanged()), SLOT(flickableMovingStateChanged()), Qt::DirectConnection);
     128    connect(m_flickProvider, SIGNAL(movementStarted()), SLOT(flickableMoveStarted()), Qt::DirectConnection);
     129    connect(m_flickProvider, SIGNAL(movementEnded()), SLOT(flickableMoveEnded()), Qt::DirectConnection);
    129130
    130131    connect(m_scaleAnimation, SIGNAL(valueChanged(QVariant)),
     
    188189}
    189190
    190 void QtViewportInteractionEngine::flickableMovingStateChanged()
    191 {
    192     if (m_flickProvider->isMoving()) {
    193         if (m_scrollUpdateDeferrer)
    194             return; // We get the isMoving() signal multiple times.
    195         panMoveStarted();
    196     } else
    197         panMoveEnded();
    198 }
    199 
    200 void QtViewportInteractionEngine::panMoveStarted()
    201 {
     191void QtViewportInteractionEngine::flickableMoveStarted()
     192{
     193    Q_ASSERT(m_flickProvider->isMoving());
    202194    m_scrollUpdateDeferrer = adoptPtr(new ViewportUpdateDeferrer(this));
    203195
     
    207199}
    208200
    209 void QtViewportInteractionEngine::panMoveEnded()
    210 {
     201void QtViewportInteractionEngine::flickableMoveEnded()
     202{
     203    Q_ASSERT(!m_flickProvider->isMoving());
    211204    // This method is called on the end of the pan or pan kinetic animation.
    212205    m_scrollUpdateDeferrer.clear();
  • trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h

    r108771 r109094  
    114114    void itemSizeChanged();
    115115
    116     void flickableMovingStateChanged();
    117116    void flickableMovingPositionUpdate();
    118117
    119118    void scaleAnimationStateChanged(QAbstractAnimation::State, QAbstractAnimation::State);
    120119    void scaleAnimationValueChanged(QVariant value) { setItemRectVisible(value.toRectF()); }
     120
     121    void flickableMoveStarted(); // Called when panning starts.
     122    void flickableMoveEnded(); //   Called when panning (+ kinetic animation) ends.
    121123
    122124private:
     
    130132    qreal innerBoundedCSSScale(qreal);
    131133    qreal outerBoundedCSSScale(qreal);
    132 
    133     void panMoveStarted(); // Called when panning starts.
    134     void panMoveEnded(); //   Called when panning (+ kinetic animation) ends.
    135134
    136135    QRectF computePosRangeForItemAtScale(qreal itemScale) const;
Note: See TracChangeset for help on using the changeset viewer.