Title: [131727] trunk/Tools
Revision
131727
Author
[email protected]
Date
2012-10-18 04:28:21 -0700 (Thu, 18 Oct 2012)

Log Message

[Qt] OpenGL rendering is not possible on bots using Xvfb
https://bugs.webkit.org/show_bug.cgi?id=99463

Reviewed by Jocelyn Turcotte.

Added a workaround to be able to disallow UI side OpenGL rendering
if the environment is not suitable because it can be extremely slow
with a software backend.

* Scripts/webkitpy/layout_tests/port/qt.py:
(QtPort.setup_environ_for_server): Let the environment variable
QT_WEBKIT_DISABLE_UIPROCESS_DUMPPIXELS reach the driver. This variable
should be defined on bots that don't have a suitable OpenGL environment.
* WebKitTestRunner/PlatformWebView.h:
(PlatformWebView):
* WebKitTestRunner/qt/PlatformWebViewQt.cpp:
(WTR::WrapperWindow::handleStatusChanged): Don't try to create an OpenGL
surface and set the setRenderWithoutShowing flag on the window if the
variable is set.
(WTR::PlatformWebView::windowSnapshotImage):
(WTR::PlatformWebView::windowShapshotEnabled):
(WTR):
* WebKitTestRunner/qt/TestInvocationQt.cpp:
(WTR::TestInvocation::dumpPixelsAndCompareWithExpected): Use the old method
of evaluating pixel results if the snapshot is not supported, that is to check
the image we got from the web process. This is necessary for the bots to be able
to run ref tests.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (131726 => 131727)


--- trunk/Tools/ChangeLog	2012-10-18 11:26:27 UTC (rev 131726)
+++ trunk/Tools/ChangeLog	2012-10-18 11:28:21 UTC (rev 131727)
@@ -1,3 +1,33 @@
+2012-10-18  Balazs Kelemen  <[email protected]>
+
+        [Qt] OpenGL rendering is not possible on bots using Xvfb
+        https://bugs.webkit.org/show_bug.cgi?id=99463
+
+        Reviewed by Jocelyn Turcotte.
+
+        Added a workaround to be able to disallow UI side OpenGL rendering
+        if the environment is not suitable because it can be extremely slow
+        with a software backend.
+
+        * Scripts/webkitpy/layout_tests/port/qt.py:
+        (QtPort.setup_environ_for_server): Let the environment variable
+        QT_WEBKIT_DISABLE_UIPROCESS_DUMPPIXELS reach the driver. This variable
+        should be defined on bots that don't have a suitable OpenGL environment.
+        * WebKitTestRunner/PlatformWebView.h:
+        (PlatformWebView):
+        * WebKitTestRunner/qt/PlatformWebViewQt.cpp:
+        (WTR::WrapperWindow::handleStatusChanged): Don't try to create an OpenGL
+        surface and set the setRenderWithoutShowing flag on the window if the
+        variable is set.
+        (WTR::PlatformWebView::windowSnapshotImage):
+        (WTR::PlatformWebView::windowShapshotEnabled):
+        (WTR):
+        * WebKitTestRunner/qt/TestInvocationQt.cpp:
+        (WTR::TestInvocation::dumpPixelsAndCompareWithExpected): Use the old method
+        of evaluating pixel results if the snapshot is not supported, that is to check
+        the image we got from the web process. This is necessary for the bots to be able
+        to run ref tests.
+
 2012-10-15  Balazs Kelemen  <[email protected]>
 
         [Qt] Implement pixel snapshot generation in WTR

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/qt.py (131726 => 131727)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/qt.py	2012-10-18 11:26:27 UTC (rev 131726)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/qt.py	2012-10-18 11:28:21 UTC (rev 131727)
@@ -160,6 +160,7 @@
         self._copy_value_from_environ_if_set(clean_env, 'DISABLE_NI_WARNING')
         self._copy_value_from_environ_if_set(clean_env, 'QT_WEBKIT_PAUSE_UI_PROCESS')
         self._copy_value_from_environ_if_set(clean_env, 'QT_QPA_PLATFORM_PLUGIN_PATH')
+        self._copy_value_from_environ_if_set(clean_env, 'QT_WEBKIT_DISABLE_UIPROCESS_DUMPPIXELS')
         return clean_env
 
     # FIXME: We should find a way to share this implmentation with Gtk,

Modified: trunk/Tools/WebKitTestRunner/PlatformWebView.h (131726 => 131727)


--- trunk/Tools/WebKitTestRunner/PlatformWebView.h	2012-10-18 11:26:27 UTC (rev 131726)
+++ trunk/Tools/WebKitTestRunner/PlatformWebView.h	2012-10-18 11:28:21 UTC (rev 131727)
@@ -77,6 +77,7 @@
     bool sendEvent(QEvent*);
     void postEvent(QEvent*);
     void setModalEventLoop(QEventLoop* eventLoop) { m_modalEventLoop = eventLoop; }
+    static bool windowShapshotEnabled();
 #endif
 
     WKRect windowFrame();

Modified: trunk/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp (131726 => 131727)


--- trunk/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp	2012-10-18 11:26:27 UTC (rev 131726)
+++ trunk/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp	2012-10-18 11:28:21 UTC (rev 131727)
@@ -62,11 +62,12 @@
         m_view->setParentItem(rootObject());
         QQmlProperty::write(m_view, "anchors.fill", qVariantFromValue(rootObject()));
 
-        setSurfaceType(OpenGLSurface);
-        create();
+        if (PlatformWebView::windowShapshotEnabled()) {
+            setSurfaceType(OpenGLSurface);
+            create();
+            QQuickWindowPrivate::get(this)->setRenderWithoutShowing(true);
+        }
 
-        QQuickWindowPrivate::get(this)->setRenderWithoutShowing(true);
-
         QWindowSystemInterface::handleWindowActivated(this);
         m_view->page()->setFocus(true);
     }
@@ -161,6 +162,15 @@
     return adoptWK(WKImageCreateFromQImage(m_window->grabWindow()));
 }
 
+bool PlatformWebView::windowShapshotEnabled()
+{
+    static bool result;
+    static bool hasChecked = false;
+    if (!hasChecked)
+        result = qgetenv("QT_WEBKIT_DISABLE_UIPROCESS_DUMPPIXELS") != "1";
+    return result;
+}
+
 } // namespace WTR
 
 #include "PlatformWebViewQt.moc"

Modified: trunk/Tools/WebKitTestRunner/qt/TestInvocationQt.cpp (131726 => 131727)


--- trunk/Tools/WebKitTestRunner/qt/TestInvocationQt.cpp	2012-10-18 11:26:27 UTC (rev 131726)
+++ trunk/Tools/WebKitTestRunner/qt/TestInvocationQt.cpp	2012-10-18 11:28:21 UTC (rev 131727)
@@ -73,20 +73,23 @@
 
 void TestInvocation::dumpPixelsAndCompareWithExpected(WKImageRef imageRef, WKArrayRef repaintRects)
 {
-    WKPageRef page = TestController::shared().mainWebView()->page();
-    WKPageForceRepaint(page, this, &forceRepaintDoneCallback);
+    QImage image;
+    if (PlatformWebView::windowShapshotEnabled()) {
+        WKPageRef page = TestController::shared().mainWebView()->page();
+        WKPageForceRepaint(page, this, &forceRepaintDoneCallback);
 
-    TestController::shared().runUntil(m_gotRepaint, TestController::ShortTimeout);
+        TestController::shared().runUntil(m_gotRepaint, TestController::ShortTimeout);
 
-    QImage image;
-    if (m_gotRepaint)
-        image = WKImageCreateQImage(TestController::shared().mainWebView()->windowSnapshotImage().get());
-    else {
-        // The test harness expects an image so we output an empty one.
-        WKRect windowRect = TestController::shared().mainWebView()->windowFrame();
-        image = QImage(QSize(windowRect.size.width, windowRect.size.height), QImage::Format_ARGB32_Premultiplied);
-        image.fill(Qt::red);
-    }
+        if (m_gotRepaint)
+            image = WKImageCreateQImage(TestController::shared().mainWebView()->windowSnapshotImage().get());
+        else {
+            // The test harness expects an image so we output an empty one.
+            WKRect windowRect = TestController::shared().mainWebView()->windowFrame();
+            image = QImage(QSize(windowRect.size.width, windowRect.size.height), QImage::Format_ARGB32_Premultiplied);
+            image.fill(Qt::red);
+        }
+    } else
+        image = WKImageCreateQImage(imageRef);
 
     if (repaintRects) {
         QImage mask(image.size(), image.format());
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to