[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

antti at apple.com antti at apple.com
Thu Apr 8 02:22:10 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 4adbad5a22b291902469e158314cebdafd1c8830
Author: antti at apple.com <antti at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Mar 15 00:51:57 2010 +0000

    https://bugs.webkit.org/show_bug.cgi?id=35146
    Support tiled backing store
    
    Reviewed by Simon Hausmann.
    
    Implements a basic tiled backing store mechanism. Tiles are created and
    deleted on demand. The page content is cached to the tiles. Tile content
    is kept in sync with the document. Since the backing store covers area
    larger than the currently visible viewport, the document can be scrolled
    quickly without having to enter rendering tree painting.
    
    The tile management code is platform independent. This patch has simple QPixmap
    based tile implementation for Qt.
    
    The feature is behind ENABLE_TILED_BACKING_STORE flag.
    
    * Api/qgraphicswebview.cpp:
    (QGraphicsWebViewPrivate::visibleRect):
    (QGraphicsWebView::paint):
    * Api/qwebframe.cpp:
    (QWebFramePrivate::renderContentsLayerAbsoluteCoords):
    * Api/qwebframe.h:
    * Api/qwebsettings.cpp:
    (QWebSettingsPrivate::apply):
    * Api/qwebsettings.h:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55978 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/qt/Api/qgraphicswebview.cpp b/WebKit/qt/Api/qgraphicswebview.cpp
index 9720e0c..e133577 100644
--- a/WebKit/qt/Api/qgraphicswebview.cpp
+++ b/WebKit/qt/Api/qgraphicswebview.cpp
@@ -26,7 +26,10 @@
 #include "qwebpage.h"
 #include "qwebpage_p.h"
 #include "QWebPageClient.h"
-#include <FrameView.h>
+#include "FrameView.h"
+#include "GraphicsContext.h"
+#include "IntRect.h"
+#include "TiledBackingStore.h"
 #include <QtCore/qmetaobject.h>
 #include <QtCore/qsharedpointer.h>
 #include <QtCore/qtimer.h>
@@ -35,6 +38,7 @@
 #include <QtGui/qgraphicssceneevent.h>
 #include <QtGui/qgraphicsview.h>
 #include <QtGui/qpixmapcache.h>
+#include <QtGui/qscrollbar.h>
 #include <QtGui/qstyleoption.h>
 #if defined(Q_WS_X11)
 #include <QX11Info>
@@ -120,6 +124,7 @@ public:
 #endif
     
     void updateResizesToContentsForPage();
+    QRectF visibleRect() const;
 
     void syncLayers();
     void _q_doLoadFinished(bool success);
@@ -340,6 +345,23 @@ void QGraphicsWebViewPrivate::_q_contentsSizeChanged(const QSize& size)
     q->setGeometry(QRectF(q->geometry().topLeft(), size));
 }
 
+QRectF QGraphicsWebViewPrivate::visibleRect() const
+{
+    if (!q->scene())
+        return QRectF();
+    QList<QGraphicsView*> views = q->scene()->views();
+    if (views.size() > 1) {
+        qDebug() << "QGraphicsWebView is in more than one graphics views, unable to compute the visible rect";
+        return QRectF();
+    }
+    if (views.size() < 1)
+        return QRectF();
+
+    int xPosition = views[0]->horizontalScrollBar()->value();
+    int yPosition = views[0]->verticalScrollBar()->value();
+    return q->mapRectFromScene(QRectF(QPoint(xPosition, yPosition), views[0]->viewport()->size()));
+}
+
 /*!
     \class QGraphicsWebView
     \brief The QGraphicsWebView class allows Web content to be added to a GraphicsView.
@@ -482,6 +504,17 @@ QWebPage* QGraphicsWebView::page() const
 */
 void QGraphicsWebView::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget*)
 {
+#if ENABLE(TILED_BACKING_STORE)
+    // FIXME: Scrollbars could be drawn with the overlay layer when using tiling.
+    if (WebCore::TiledBackingStore* backingStore = QWebFramePrivate::core(page()->mainFrame())->tiledBackingStore()) {
+        // FIXME: We should set the backing store viewpart earlier than in paint.
+        backingStore->viewportChanged(WebCore::IntRect(d->visibleRect()));
+        // QWebFrame::render is a public API, bypass it for tiled rendering so behavior does not need to change.
+        WebCore::GraphicsContext context(painter); 
+        page()->mainFrame()->d->renderContentsLayerAbsoluteCoords(&context, option->exposedRect.toAlignedRect());
+        return;
+    } 
+#endif
 #if USE(ACCELERATED_COMPOSITING)
     page()->mainFrame()->render(painter, d->overlay ? QWebFrame::ContentsLayer : QWebFrame::AllLayers, option->exposedRect.toAlignedRect());
 #else
diff --git a/WebKit/qt/Api/qwebframe.cpp b/WebKit/qt/Api/qwebframe.cpp
index 9cfc58f..a72f39f 100644
--- a/WebKit/qt/Api/qwebframe.cpp
+++ b/WebKit/qt/Api/qwebframe.cpp
@@ -58,6 +58,7 @@
 #include "SelectionController.h"
 #include "SubstituteData.h"
 #include "SVGSMILElement.h"
+#include "TiledBackingStore.h"
 #include "htmlediting.h"
 #include "markup.h"
 #include "qt_instance.h"
@@ -339,7 +340,13 @@ void QWebFramePrivate::renderContentsLayerAbsoluteCoords(GraphicsContext* contex
     QPainter* painter = context->platformContext();
 
     WebCore::FrameView* view = frame->view();
-    view->layoutIfNeededRecursive();
+    
+#if ENABLE(TILED_BACKING_STORE)
+    if (!frame->tiledBackingStore())
+        view->layoutIfNeededRecursive();
+#else
+    view->layoutIfNeededRecursive()
+#endif
 
     for (int i = 0; i < vector.size(); ++i) {
         const QRect& clipRect = vector.at(i);
@@ -348,7 +355,14 @@ void QWebFramePrivate::renderContentsLayerAbsoluteCoords(GraphicsContext* contex
         painter->setClipRect(clipRect, Qt::IntersectClip);
 
         context->save();
+#if ENABLE(TILED_BACKING_STORE)
+        if (frame->tiledBackingStore())
+            frame->tiledBackingStore()->paint(context, clipRect);
+        else
+            view->paintContents(context, clipRect);
+#else
         view->paintContents(context, clipRect);
+#endif
         context->restore();
 
         painter->restore();
diff --git a/WebKit/qt/Api/qwebframe.h b/WebKit/qt/Api/qwebframe.h
index 68594fd..ca5d3b6 100644
--- a/WebKit/qt/Api/qwebframe.h
+++ b/WebKit/qt/Api/qwebframe.h
@@ -222,6 +222,7 @@ Q_SIGNALS:
     void pageChanged();
 
 private:
+    friend class QGraphicsWebView;
     friend class QWebPage;
     friend class QWebPagePrivate;
     friend class QWebFramePrivate;
diff --git a/WebKit/qt/Api/qwebsettings.cpp b/WebKit/qt/Api/qwebsettings.cpp
index 59a7d83..582d9ac 100644
--- a/WebKit/qt/Api/qwebsettings.cpp
+++ b/WebKit/qt/Api/qwebsettings.cpp
@@ -237,6 +237,12 @@ void QWebSettingsPrivate::apply()
         value = attributes.value(QWebSettings::XSSAuditorEnabled,
                                       global->attributes.value(QWebSettings::XSSAuditorEnabled));
         settings->setXSSAuditorEnabled(value);
+        
+#if ENABLE(TILED_BACKING_STORE)
+        value = attributes.value(QWebSettings::TiledBackingStoreEnabled,
+                                      global->attributes.value(QWebSettings::TiledBackingStoreEnabled));
+        settings->setTiledBackingStoreEnabled(value);
+#endif
 
         settings->setUsesPageCache(WebCore::pageCache()->capacity());
     } else {
diff --git a/WebKit/qt/Api/qwebsettings.h b/WebKit/qt/Api/qwebsettings.h
index 94013c8..dc2bce0 100644
--- a/WebKit/qt/Api/qwebsettings.h
+++ b/WebKit/qt/Api/qwebsettings.h
@@ -72,7 +72,8 @@ public:
         AcceleratedCompositingEnabled,
         WebGLEnabled,
         SpatialNavigationEnabled,
-        LocalContentCanAccessFileUrls
+        LocalContentCanAccessFileUrls,
+        TiledBackingStoreEnabled
     };
     enum WebGraphic {
         MissingImageGraphic,
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index f77d077..d4bf1f0 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,31 @@
+2010-03-14  Antti Koivisto  <koivisto at iki.fi>
+
+        Reviewed by Simon Hausmann.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35146
+        Support tiled backing store
+
+        Implements a basic tiled backing store mechanism. Tiles are created and 
+        deleted on demand. The page content is cached to the tiles. Tile content
+        is kept in sync with the document. Since the backing store covers area
+        larger than the currently visible viewport, the document can be scrolled
+        quickly without having to enter rendering tree painting.
+        
+        The tile management code is platform independent. This patch has simple QPixmap
+        based tile implementation for Qt.
+        
+        The feature is behind ENABLE_TILED_BACKING_STORE flag.
+
+        * Api/qgraphicswebview.cpp:
+        (QGraphicsWebViewPrivate::visibleRect):
+        (QGraphicsWebView::paint):
+        * Api/qwebframe.cpp:
+        (QWebFramePrivate::renderContentsLayerAbsoluteCoords):
+        * Api/qwebframe.h:
+        * Api/qwebsettings.cpp:
+        (QWebSettingsPrivate::apply):
+        * Api/qwebsettings.h:
+
 2010-03-13  Csaba Osztrogonác  <ossy at webkit.org>
 
         [Qt] Enable accelerated compositing by default

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list