[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.20-204-g221d8e8

kenneth at webkit.org kenneth at webkit.org
Wed Feb 10 22:16:55 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit d3078b8fdadc80907f2d9fb7e8d13bd16873c048
Author: kenneth at webkit.org <kenneth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Feb 5 19:46:19 2010 +0000

    [Qt] Apply the command line options as settings to the graphics system.
    
    Reviewed by Ariya Hidayat.
    
    * QtLauncher/main.cpp:
    (LauncherWindow::LauncherWindow):
    (requiresGraphicsView):
    (LauncherApplication::handleUserOptions):
    * QtLauncher/webview.h:
    (WebViewGraphicsBased::setItemCacheMode):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54437 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 40d19d2..0a1f0f6 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,17 @@
+2010-02-05  Kenneth Rohde Christiansen  <kenneth at webkit.org>
+
+        Reviewed by Ariya Hidayat.
+
+        [Qt] Apply the command line options as settings to the
+        graphics system.
+
+        * QtLauncher/main.cpp:
+        (LauncherWindow::LauncherWindow):
+        (requiresGraphicsView):
+        (LauncherApplication::handleUserOptions):
+        * QtLauncher/webview.h:
+        (WebViewGraphicsBased::setItemCacheMode):
+
 2010-02-05  Tor Arne Vestbø  <tor.arne.vestbo at nokia.com>
 
         Reviewed by Simon Hausmann.
diff --git a/WebKitTools/QtLauncher/main.cpp b/WebKitTools/QtLauncher/main.cpp
index 21723c2..b38efad 100644
--- a/WebKitTools/QtLauncher/main.cpp
+++ b/WebKitTools/QtLauncher/main.cpp
@@ -70,7 +70,12 @@
 void QWEBKIT_EXPORT qt_drt_garbageCollector_collect();
 #endif
 
-static bool useGraphicsView = false;
+
+static bool gUseGraphicsView = false;
+static bool gUseCompositing = false;
+static bool gCacheWebView = false;
+static QGraphicsView::ViewportUpdateMode gViewportUpdateMode = QGraphicsView::MinimalViewportUpdate;
+
 
 class LauncherWindow : public MainWindow {
     Q_OBJECT
@@ -142,13 +147,16 @@ LauncherWindow::LauncherWindow(QString url)
 
     resize(800, 600);
 
-    if (!useGraphicsView) {
+    if (!gUseGraphicsView) {
         WebViewTraditional* view = new WebViewTraditional(splitter);
         view->setPage(page());
         m_view = view;
     } else {
         WebViewGraphicsBased* view = new WebViewGraphicsBased(splitter);
         view->setPage(page());
+        view->setViewportUpdateMode(gViewportUpdateMode);
+        view->setItemCacheMode(gCacheWebView ? QGraphicsItem::DeviceCoordinateCache : QGraphicsItem::NoCache);
+        page()->settings()->setAttribute(QWebSettings::AcceleratedCompositingEnabled, gUseCompositing);
         m_view = view;
     }
 
@@ -590,7 +598,7 @@ LauncherApplication::LauncherApplication(int& argc, char** argv)
 
 static void requiresGraphicsView(const QString& option)
 {
-    if (useGraphicsView)
+    if (gUseGraphicsView)
         return;
     appQuit(1, QString("%1 only works in combination with the -graphicsbased option").arg(option));
 }
@@ -618,16 +626,16 @@ void LauncherApplication::handleUserOptions()
     }
 
     if (args.contains("-graphicsbased"))
-        useGraphicsView = true;
+        gUseGraphicsView = true;
 
     if (args.contains("-compositing")) {
         requiresGraphicsView("-compositing");
-        QWebSettings::globalSettings()->setAttribute(QWebSettings::AcceleratedCompositingEnabled, true);
+        gUseCompositing = true;
     }
 
     if (args.contains("-cache-webview")) {
         requiresGraphicsView("-cache-webview");
-        // view->setCacheMode(QGraphicsItem::DeviceCoordinateCache);
+        gCacheWebView = true;
     }
 
     QString arg1("-viewport-update-mode");
@@ -642,7 +650,7 @@ void LauncherApplication::handleUserOptions()
         if (idx == -1)
             appQuit(1, QString("%1 value has to be one of [%2]").arg(arg1).arg(formatKeys(updateModes)));
 
-        // view->setViewportUpdateMode(static_cast<QGraphicsView::ViewportUpdateMode>(idx));
+        gViewportUpdateMode = static_cast<QGraphicsView::ViewportUpdateMode>(idx);
     }
 
     int robotIndex = args.indexOf("-r");
diff --git a/WebKitTools/QtLauncher/webview.h b/WebKitTools/QtLauncher/webview.h
index 1d385c9..6d26664 100644
--- a/WebKitTools/QtLauncher/webview.h
+++ b/WebKitTools/QtLauncher/webview.h
@@ -70,6 +70,7 @@ public:
     WebViewGraphicsBased(QWidget* parent);
     virtual void resizeEvent(QResizeEvent*);
     void setPage(QWebPage* page) { m_item->setPage(page); }
+    void setItemCacheMode(QGraphicsItem::CacheMode mode) { m_item->setCacheMode(mode); }
 
 private:
     GraphicsWebView* m_item;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list