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

andreas.kling at nokia.com andreas.kling at nokia.com
Wed Dec 22 13:54:54 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit d65b646afbc83cf3ffdd1066acd70a8ed7b51517
Author: andreas.kling at nokia.com <andreas.kling at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Sep 29 16:46:27 2010 +0000

    2010-09-29  Andreas Kling  <andreas.kling at nokia.com>
    
            Reviewed by Ariya Hidayat.
    
            [Qt] Don't keep local reference to QGraphicsItemOverlay in QGWVPrivate
            https://bugs.webkit.org/show_bug.cgi?id=46812
    
            Get the QGraphicsItemOverlay* via the QWebPageClient (d->page->d->client)
            instead of keeping a local pointer to it.
    
            This is cleanup for a follow-up patch.
    
            * Api/qgraphicswebview.cpp:
            (QGraphicsWebViewPrivate::overlay):
            (QGraphicsWebView::paint):
            (QGraphicsWebView::setPage):
            (QGraphicsWebView::updateGeometry):
            (QGraphicsWebView::setGeometry):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68653 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/qt/Api/qgraphicswebview.cpp b/WebKit/qt/Api/qgraphicswebview.cpp
index 36d4326..936d36d 100644
--- a/WebKit/qt/Api/qgraphicswebview.cpp
+++ b/WebKit/qt/Api/qgraphicswebview.cpp
@@ -76,8 +76,12 @@ public:
     QWebPage* page;
     bool resizesToContents;
 
-    // Just a convenience to avoid using page->client->overlay always
-    QSharedPointer<QGraphicsItemOverlay> overlay;
+    QGraphicsItemOverlay* overlay() const
+    {
+        if (!page || !page->d->client)
+            return 0;
+        return static_cast<PageClientQGraphicsWidget*>(page->d->client)->overlay.data();
+    }
 };
 
 QGraphicsWebViewPrivate::~QGraphicsWebViewPrivate()
@@ -294,7 +298,7 @@ void QGraphicsWebView::paint(QPainter* painter, const QStyleOptionGraphicsItem*
     } 
 #endif
 #if USE(ACCELERATED_COMPOSITING)
-    page()->mainFrame()->render(painter, d->overlay ? QWebFrame::ContentsLayer : QWebFrame::AllLayers, option->exposedRect.toAlignedRect());
+    page()->mainFrame()->render(painter, d->overlay() ? QWebFrame::ContentsLayer : QWebFrame::AllLayers, option->exposedRect.toAlignedRect());
 #else
     page()->mainFrame()->render(painter, QWebFrame::AllLayers, option->exposedRect.toRect());
 #endif
@@ -445,10 +449,9 @@ void QGraphicsWebView::setPage(QWebPage* page)
         return;
 
     d->page->d->client = new PageClientQGraphicsWidget(this, page); // set the page client
-    d->overlay = static_cast<PageClientQGraphicsWidget*>(d->page->d->client)->overlay;
 
-    if (d->overlay)
-        d->overlay->prepareGraphicsItemGeometryChange();
+    if (d->overlay())
+        d->overlay()->prepareGraphicsItemGeometryChange();
 
     QSize size = geometry().size().toSize();
     page->setViewportSize(size);
@@ -560,8 +563,8 @@ qreal QGraphicsWebView::zoomFactor() const
 */
 void QGraphicsWebView::updateGeometry()
 {
-    if (d->overlay)
-        d->overlay->prepareGraphicsItemGeometryChange();
+    if (d->overlay())
+        d->overlay()->prepareGraphicsItemGeometryChange();
 
     QGraphicsWidget::updateGeometry();
 
@@ -578,8 +581,8 @@ void QGraphicsWebView::setGeometry(const QRectF& rect)
 {
     QGraphicsWidget::setGeometry(rect);
 
-    if (d->overlay)
-        d->overlay->prepareGraphicsItemGeometryChange();
+    if (d->overlay())
+        d->overlay()->prepareGraphicsItemGeometryChange();
 
     if (!d->page)
         return;
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index 7a2c064..7e70a9e 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,22 @@
+2010-09-29  Andreas Kling  <andreas.kling at nokia.com>
+
+        Reviewed by Ariya Hidayat.
+
+        [Qt] Don't keep local reference to QGraphicsItemOverlay in QGWVPrivate
+        https://bugs.webkit.org/show_bug.cgi?id=46812
+
+        Get the QGraphicsItemOverlay* via the QWebPageClient (d->page->d->client)
+        instead of keeping a local pointer to it.
+
+        This is cleanup for a follow-up patch.
+
+        * Api/qgraphicswebview.cpp:
+        (QGraphicsWebViewPrivate::overlay):
+        (QGraphicsWebView::paint):
+        (QGraphicsWebView::setPage):
+        (QGraphicsWebView::updateGeometry):
+        (QGraphicsWebView::setGeometry):
+
 2010-09-28  Jenn Braithwaite  <jennb at chromium.org>
 
         Reviewed by Dmitry Titov.

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list