Changeset 68653 in webkit


Ignore:
Timestamp:
Sep 29, 2010 9:46:27 AM (14 years ago)
Author:
andreas.kling@nokia.com
Message:

2010-09-29 Andreas Kling <andreas.kling@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):
Location:
trunk/WebKit/qt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/qt/Api/qgraphicswebview.cpp

    r68517 r68653  
    7777    bool resizesToContents;
    7878
    79     // Just a convenience to avoid using page->client->overlay always
    80     QSharedPointer<QGraphicsItemOverlay> overlay;
     79    QGraphicsItemOverlay* overlay() const
     80    {
     81        if (!page || !page->d->client)
     82            return 0;
     83        return static_cast<PageClientQGraphicsWidget*>(page->d->client)->overlay.data();
     84    }
    8185};
    8286
     
    295299#endif
    296300#if USE(ACCELERATED_COMPOSITING)
    297     page()->mainFrame()->render(painter, d->overlay ? QWebFrame::ContentsLayer : QWebFrame::AllLayers, option->exposedRect.toAlignedRect());
     301    page()->mainFrame()->render(painter, d->overlay() ? QWebFrame::ContentsLayer : QWebFrame::AllLayers, option->exposedRect.toAlignedRect());
    298302#else
    299303    page()->mainFrame()->render(painter, QWebFrame::AllLayers, option->exposedRect.toRect());
     
    446450
    447451    d->page->d->client = new PageClientQGraphicsWidget(this, page); // set the page client
    448     d->overlay = static_cast<PageClientQGraphicsWidget*>(d->page->d->client)->overlay;
    449 
    450     if (d->overlay)
    451         d->overlay->prepareGraphicsItemGeometryChange();
     452
     453    if (d->overlay())
     454        d->overlay()->prepareGraphicsItemGeometryChange();
    452455
    453456    QSize size = geometry().size().toSize();
     
    561564void QGraphicsWebView::updateGeometry()
    562565{
    563     if (d->overlay)
    564         d->overlay->prepareGraphicsItemGeometryChange();
     566    if (d->overlay())
     567        d->overlay()->prepareGraphicsItemGeometryChange();
    565568
    566569    QGraphicsWidget::updateGeometry();
     
    579582    QGraphicsWidget::setGeometry(rect);
    580583
    581     if (d->overlay)
    582         d->overlay->prepareGraphicsItemGeometryChange();
     584    if (d->overlay())
     585        d->overlay()->prepareGraphicsItemGeometryChange();
    583586
    584587    if (!d->page)
  • trunk/WebKit/qt/ChangeLog

    r68576 r68653  
     12010-09-29  Andreas Kling  <andreas.kling@nokia.com>
     2
     3        Reviewed by Ariya Hidayat.
     4
     5        [Qt] Don't keep local reference to QGraphicsItemOverlay in QGWVPrivate
     6        https://bugs.webkit.org/show_bug.cgi?id=46812
     7
     8        Get the QGraphicsItemOverlay* via the QWebPageClient (d->page->d->client)
     9        instead of keeping a local pointer to it.
     10
     11        This is cleanup for a follow-up patch.
     12
     13        * Api/qgraphicswebview.cpp:
     14        (QGraphicsWebViewPrivate::overlay):
     15        (QGraphicsWebView::paint):
     16        (QGraphicsWebView::setPage):
     17        (QGraphicsWebView::updateGeometry):
     18        (QGraphicsWebView::setGeometry):
     19
    1202010-09-28  Jenn Braithwaite  <jennb@chromium.org>
    221
Note: See TracChangeset for help on using the changeset viewer.