2010-08-22 No'am Rosenthal <noam.rosenthal@nokia.com>
authorandreas.kling@nokia.com <andreas.kling@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Aug 2010 03:50:26 +0000 (03:50 +0000)
committerandreas.kling@nokia.com <andreas.kling@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Aug 2010 03:50:26 +0000 (03:50 +0000)
        Reviewed by Ariya Hidayat.

        [Qt] Qt test browser: enable a QGLWidget viewport with a command line argument
        https://bugs.webkit.org/show_bug.cgi?id=43010

        * QtTestBrowser/launcherwindow.cpp:
        (LauncherWindow::applyPrefs):
        * QtTestBrowser/main.cpp:
        (LauncherApplication::handleUserOptions):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@65792 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKitTools/ChangeLog
WebKitTools/QtTestBrowser/launcherwindow.cpp
WebKitTools/QtTestBrowser/main.cpp

index 913d605..eda4b7c 100644 (file)
@@ -1,3 +1,15 @@
+2010-08-22  No'am Rosenthal  <noam.rosenthal@nokia.com>
+
+        Reviewed by Ariya Hidayat.
+
+        [Qt] Qt test browser: enable a QGLWidget viewport with a command line argument
+        https://bugs.webkit.org/show_bug.cgi?id=43010
+
+        * QtTestBrowser/launcherwindow.cpp:
+        (LauncherWindow::applyPrefs):
+        * QtTestBrowser/main.cpp:
+        (LauncherApplication::handleUserOptions):
+
 2010-08-21  Sam Weinig  <sam@webkit.org>
 
         Reviewed by Dan Bernstein.
index 9b7aa0d..3b47f29 100644 (file)
@@ -617,6 +617,10 @@ void LauncherWindow::screenshot()
         pixmap.save(fileName, "png");
         label->setWindowTitle(QString("Screenshot - Saved at %1").arg(fileName));
     }
+
+#if defined(QT_CONFIGURED_WITH_OPENGL)
+    toggleQGLWidgetViewport(m_windowOptions.useQGLWidgetViewport);
+#endif
 }
 
 void LauncherWindow::setEditable(bool on)
index 842290b..ec864e9 100644 (file)
@@ -122,7 +122,8 @@ void LauncherApplication::handleUserOptions()
         appQuit(0);
     }
 
-    if (args.contains("-graphicsbased"))
+    const bool defaultForAnimations = args.contains("-default-animations");
+    if (args.contains("-graphicsbased") || defaultForAnimations)
         windowOptions.useGraphicsView = true;
 
     if (args.contains("-no-compositing")) {
@@ -135,7 +136,7 @@ void LauncherApplication::handleUserOptions()
         windowOptions.showFrameRate = true;
     }
 
-    if (args.contains("-cache-webview")) {
+    if (args.contains("-cache-webview") || defaultForAnimations) {
         requiresGraphicsView("-cache-webview");
         windowOptions.cacheWebView = true;
     }
@@ -150,6 +151,9 @@ void LauncherApplication::handleUserOptions()
         windowOptions.resizesToContents = true;
     }
 
+    if (defaultForAnimations)
+        windowOptions.viewportUpdateMode = QGraphicsView::BoundingRectViewportUpdate;
+
     QString arg1("-viewport-update-mode");
     int modeIndex = args.indexOf(arg1);
     if (modeIndex != -1) {
@@ -164,6 +168,12 @@ void LauncherApplication::handleUserOptions()
 
         windowOptions.viewportUpdateMode = static_cast<QGraphicsView::ViewportUpdateMode>(idx);
     }
+#ifdef QT_CONFIGURED_WITH_OPENGL
+    if (args.contains("-gl-viewport") || defaultForAnimations) {
+        requiresGraphicsView("-gl-viewport");
+        windowOptions.useQGLWidgetViewport = true;
+    }
+#endif
 
     QString inspectorUrlArg("-inspector-url");
     int inspectorUrlIndex = args.indexOf(inspectorUrlArg);