[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da

andreas.kling at nokia.com andreas.kling at nokia.com
Wed Dec 22 18:43:49 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 8a6dc984d52d40da1f2a378a146fd215b2a1fd49
Author: andreas.kling at nokia.com <andreas.kling at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Dec 16 18:56:55 2010 +0000

    2010-12-16  Kimmo Kinnunen  <kimmo.t.kinnunen at nokia.com>
    
            Reviewed by Andreas Kling.
    
            [Qt] Turn off drawing area updates if the item is not visible
    
            The updates are controlled by the QGraphicsItem::visible property.
    
            * UIProcess/API/qt/qgraphicswkview.cpp:
            (QGraphicsWKViewPrivate::updateViewportSize):
            (QGraphicsWKView::setGeometry):
            (QGraphicsWKView::itemChange):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74201 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 8a0eb95..e1c0341 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,16 @@
+2010-12-16  Kimmo Kinnunen  <kimmo.t.kinnunen at nokia.com>
+
+        Reviewed by Andreas Kling.
+
+        [Qt] Turn off drawing area updates if the item is not visible
+
+        The updates are controlled by the QGraphicsItem::visible property.
+
+        * UIProcess/API/qt/qgraphicswkview.cpp:
+        (QGraphicsWKViewPrivate::updateViewportSize):
+        (QGraphicsWKView::setGeometry):
+        (QGraphicsWKView::itemChange):
+
 2010-12-15  Dan Bernstein  <mitz at apple.com>
 
         Reviewed by Sam Weinig.
diff --git a/WebKit2/UIProcess/API/qt/qgraphicswkview.cpp b/WebKit2/UIProcess/API/qt/qgraphicswkview.cpp
index ff73440..9ac0b58 100644
--- a/WebKit2/UIProcess/API/qt/qgraphicswkview.cpp
+++ b/WebKit2/UIProcess/API/qt/qgraphicswkview.cpp
@@ -47,6 +47,7 @@ struct QGraphicsWKViewPrivate {
     QGraphicsWKViewPrivate(QGraphicsWKView* view);
     WKPageRef pageRef() const { return page->pageRef(); }
 
+    void updateViewportSize();
     void onScaleChanged();
     void commitScale();
 
@@ -56,6 +57,13 @@ struct QGraphicsWKViewPrivate {
     bool m_isChangingScale;
 };
 
+void QGraphicsWKViewPrivate::updateViewportSize()
+{
+    // NOTE: call geometry() as setGeometry ensures that
+    // the geometry is within legal bounds (minimumSize, maximumSize)
+    page->setViewportSize(q->geometry().size().toSize());
+}
+
 QGraphicsWKView::QGraphicsWKView(QWKContext* context, BackingStoreType backingStoreType, QGraphicsItem* parent)
     : QGraphicsWidget(parent)
     , d(new QGraphicsWKViewPrivate(this))
@@ -113,9 +121,12 @@ void QGraphicsWKView::setGeometry(const QRectF& rect)
     if (geometry().size() == oldSize)
         return;
 
-    // NOTE: call geometry() as setGeometry ensures that
-    // the geometry is within legal bounds (minimumSize, maximumSize)
-    page()->setViewportSize(geometry().size().toSize());
+    // Return early if not visible, since setting size on drawing
+    // areas when not visible is not supported.
+    if (!isVisible())
+        return;
+
+    d->updateViewportSize();
 }
 
 void QGraphicsWKView::load(const QUrl& url)
@@ -209,7 +220,19 @@ bool QGraphicsWKView::focusNextPrevChild(bool next)
 */
 QVariant QGraphicsWKView::itemChange(GraphicsItemChange change, const QVariant& value)
 {
-    // Here so that it can be reimplemented without breaking ABI.
+    if (change == ItemVisibleChange) {
+        if (value.canConvert<bool>()) {
+            DrawingAreaProxy* drawingArea = page()->d->page->drawingArea();
+            bool shouldBeVisible = value.toBool();
+            drawingArea->setPageIsVisible(shouldBeVisible);
+
+            // This item might have been resized during being
+            // invisible. Update the size in any case.
+            if (shouldBeVisible)
+                d->updateViewportSize();
+        }
+        return value;
+    }
     return QGraphicsWidget::itemChange(change, value);
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list