diff options
Diffstat (limited to 'Tools')
| -rw-r--r-- | Tools/ChangeLog | 128 | ||||
| -rw-r--r-- | Tools/Scripts/webkitpy/layout_tests/port/qt.py | 1 | ||||
| -rw-r--r-- | Tools/WebKitTestRunner/PlatformWebView.h | 1 | ||||
| -rw-r--r-- | Tools/WebKitTestRunner/Target.pri | 2 | ||||
| -rw-r--r-- | Tools/WebKitTestRunner/TestInvocation.cpp | 34 | ||||
| -rw-r--r-- | Tools/WebKitTestRunner/TestInvocation.h | 10 | ||||
| -rw-r--r-- | Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp | 20 | ||||
| -rw-r--r-- | Tools/WebKitTestRunner/qt/TestInvocationQt.cpp | 26 | ||||
| -rw-r--r-- | Tools/qmake/mkspecs/features/default_pre.prf | 8 | ||||
| -rw-r--r-- | Tools/qmake/mkspecs/features/production_build.prf | 3 | ||||
| -rw-r--r-- | Tools/qmake/mkspecs/features/unix/default_post.prf | 2 |
11 files changed, 205 insertions, 30 deletions
diff --git a/Tools/ChangeLog b/Tools/ChangeLog index b7eb6dc0b..ceabcd3f1 100644 --- a/Tools/ChangeLog +++ b/Tools/ChangeLog @@ -1,5 +1,133 @@ 2012-10-18 Simon Hausmann <simon.hausmann@digia.com> + [Qt] Reduce memory pressure at link time with less compromise on speed of linking + + Reviewed by Csaba Osztrogonác. + + Revert r131718 that made us pass -fno-keep-memory to the linker for any + i386 builds. The downside of passing that option is that it slows down + the process of linking and as Ossy determined, release builds do _not_ + take as much memory (2.x GB) for linking but much less (~350MB). + + However there is one condition where even release builds do take up too + much memory, and that is when Qt is configured with + -separate-debug-info, because it adds a -g next to -O2. The recent + introduction of loading qt_build_config enabled us to read qmodule.pri, + which adds the -g if Qt is configured with -separate-debug-info. So + instead of playing with -fno-keep-memory (which is a last resort + measure for debug builds) we should tweak our existing mechanism of + dealing with the debug info: + + production_build.prf tries to ensure that we use -g only in static + libraries that contain API facing code, so that we get nice backtraces + at least into the API layer. For other static libraries such as WebCore + we skip -g via CONFIG += no_debug_info. One of the conditions for + enabling this tweak is CONFIG(debug, debug|release). This patch adds + contains(QT_CONFIG,separate_debug_info) to the conditions. + + The patch also extend the CONFIG += no_debug_info part with the removal + of no_separate_debug_info. There is no point in running an extra + build step to strip out debug info into a separate file if at the same + time we tell the compiler to not generate any debug info altogether. + + * qmake/mkspecs/features/production_build.prf: + * qmake/mkspecs/features/unix/default_post.prf: + +2012-10-18 Balazs Kelemen <kbalazs@webkit.org> + + [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 <kbalazs@webkit.org> + + [Qt] Implement pixel snapshot generation in WTR + https://bugs.webkit.org/show_bug.cgi?id=95992 + + Reviewed by Jocelyn Turcotte. + + Switch the Qt implementation of the PlatformWebView to use + QQuickWindow::grabWindow to generate the pixel results. This way + we will go through the scenegraph and test the actual rendering backend. + We use QQuickWindowPrivate::setRenderWithoutShowing to avoid the need of + showing the window. + + * WebKitTestRunner/Target.pri: Had to added a bunch + of modules to be able to use QQuickWindowPrivate. + * WebKitTestRunner/qt/PlatformWebViewQt.cpp: + (WTR::WrapperWindow::handleStatusChanged): + (WTR::PlatformWebView::windowSnapshotImage): + +2012-10-15 Balazs Kelemen <kbalazs@webkit.org> + + [Qt][WTR] Do a forced repaint before generating pixel results + https://bugs.webkit.org/show_bug.cgi?id=98654 + + Reviewed by Jocelyn Turcotte. + + Do a forced repaint before grabbing the pixel snapshot. This extra + synchronisation is necessary with the CoordinatedGraphics rendering + backend because it has a fully asynchronous nature. This patch make + us using the window snapshot for pixel results which is necessary to + capture animations and other dynamic content. The actual grabbing of + the window has not been implemented in this patch. It will come in + a follow-up. + + * WebKitTestRunner/TestInvocation.cpp: + (WTR::TestInvocation::invoke): + (WTR::TestInvocation::dump): Store results in member variables. + Don't close output channels yet. + (WTR::TestInvocation::dumpResults): Added. This is where we dump + the results if no error happened. + (WTR): + (WTR::TestInvocation::didReceiveMessageFromInjectedBundle): + * WebKitTestRunner/TestInvocation.h: + (TestInvocation): + * WebKitTestRunner/qt/PlatformWebViewQt.cpp: + (WTR::PlatformWebView::windowSnapshotImage): + * WebKitTestRunner/qt/TestInvocationQt.cpp: + (WTR::TestInvocation::forceRepaintDoneCallback): + (WTR): + (WTR::TestInvocation::dumpPixelsAndCompareWithExpected): + +2012-10-18 Simon Hausmann <simon.hausmann@digia.com> + + [Qt] Clean up variables controlling Qt module creation/handling + + Reviewed by Tor Arne Vestbø. + + We now depend on a Qt 5 version that is new enough to allow us to + clean this up. Qt's default_pre.prf uses MODULE_QMAKE_OUTDIR, but + the other MODULE_BASE_* variables are onl used in qmodule.prf. + + * qmake/mkspecs/features/default_pre.prf: + +2012-10-18 Simon Hausmann <simon.hausmann@digia.com> + [Qt] Reduce memory pressure during link time Reviewed by Tor Arne Vestbø. diff --git a/Tools/Scripts/webkitpy/layout_tests/port/qt.py b/Tools/Scripts/webkitpy/layout_tests/port/qt.py index 5b8342d9c..76aadef2a 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/qt.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/qt.py @@ -160,6 +160,7 @@ class QtPort(Port): 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, diff --git a/Tools/WebKitTestRunner/PlatformWebView.h b/Tools/WebKitTestRunner/PlatformWebView.h index 43b79c33e..13859e143 100644 --- a/Tools/WebKitTestRunner/PlatformWebView.h +++ b/Tools/WebKitTestRunner/PlatformWebView.h @@ -77,6 +77,7 @@ public: bool sendEvent(QEvent*); void postEvent(QEvent*); void setModalEventLoop(QEventLoop* eventLoop) { m_modalEventLoop = eventLoop; } + static bool windowShapshotEnabled(); #endif WKRect windowFrame(); diff --git a/Tools/WebKitTestRunner/Target.pri b/Tools/WebKitTestRunner/Target.pri index 320f6b97e..120a027ce 100644 --- a/Tools/WebKitTestRunner/Target.pri +++ b/Tools/WebKitTestRunner/Target.pri @@ -33,7 +33,7 @@ SOURCES += \ DESTDIR = $${ROOT_BUILD_DIR}/bin -QT = core gui gui-private widgets network testlib quick quick-private webkitwidgets +QT = core core-private gui gui-private widgets network testlib quick quick-private webkitwidgets qml-private v8-private WEBKIT += wtf javascriptcore webkit2 diff --git a/Tools/WebKitTestRunner/TestInvocation.cpp b/Tools/WebKitTestRunner/TestInvocation.cpp index 31b998890..040adb544 100644 --- a/Tools/WebKitTestRunner/TestInvocation.cpp +++ b/Tools/WebKitTestRunner/TestInvocation.cpp @@ -192,6 +192,8 @@ void TestInvocation::invoke() goto end; } + dumpResults(); + end: #if ENABLE(INSPECTOR) if (m_gotInitialResponse) @@ -235,6 +237,17 @@ void TestInvocation::dump(const char* textToStdout, const char* textToStderr, bo fflush(stderr); } +void TestInvocation::dumpResults() +{ + dump(toWTFString(m_textOutput.get()).utf8().data()); + + if (m_dumpPixels && m_pixelResult) + dumpPixelsAndCompareWithExpected(m_pixelResult.get(), m_repaintRects.get()); + + fputs("#EOF\n", stdout); + fflush(stdout); +} + bool TestInvocation::compareActualHashToExpectedAndDumpResults(const char actualHash[33]) { // Compute the hash of the bitmap context pixels @@ -278,26 +291,15 @@ void TestInvocation::didReceiveMessageFromInjectedBundle(WKStringRef messageName WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody); WKRetainPtr<WKStringRef> textOutputKey(AdoptWK, WKStringCreateWithUTF8CString("TextOutput")); - WKStringRef textOutput = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, textOutputKey.get())); + m_textOutput = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, textOutputKey.get())); WKRetainPtr<WKStringRef> pixelResultKey = adoptWK(WKStringCreateWithUTF8CString("PixelResult")); - WKImageRef pixelResult = static_cast<WKImageRef>(WKDictionaryGetItemForKey(messageBodyDictionary, pixelResultKey.get())); - ASSERT(!pixelResult || m_dumpPixels); - - WKRetainPtr<WKStringRef> repaintRectsKey = adoptWK(WKStringCreateWithUTF8CString("RepaintRects")); - WKArrayRef repaintRects = static_cast<WKArrayRef>(WKDictionaryGetItemForKey(messageBodyDictionary, repaintRectsKey.get())); + m_pixelResult = static_cast<WKImageRef>(WKDictionaryGetItemForKey(messageBodyDictionary, pixelResultKey.get())); + ASSERT(!m_pixelResult || m_dumpPixels); - // Dump text. - dump(toWTFString(textOutput).utf8().data()); - - // Dump pixels (if necessary). - if (m_dumpPixels && pixelResult) - dumpPixelsAndCompareWithExpected(pixelResult, repaintRects); + WKRetainPtr<WKStringRef> repaintRectsKey = adoptWK(WKStringCreateWithUTF8CString("RepaintRects")); + m_repaintRects = static_cast<WKArrayRef>(WKDictionaryGetItemForKey(messageBodyDictionary, repaintRectsKey.get())); - fputs("#EOF\n", stdout); - fflush(stdout); - fflush(stderr); - m_gotFinalMessage = true; TestController::shared().notifyDone(); return; diff --git a/Tools/WebKitTestRunner/TestInvocation.h b/Tools/WebKitTestRunner/TestInvocation.h index 49641e9ee..b5506551b 100644 --- a/Tools/WebKitTestRunner/TestInvocation.h +++ b/Tools/WebKitTestRunner/TestInvocation.h @@ -46,9 +46,15 @@ public: static void dumpWebProcessUnresponsiveness(const char* textToStdout); private: + void dumpResults(); static void dump(const char* textToStdout, const char* textToStderr = 0, bool seenError = false); void dumpPixelsAndCompareWithExpected(WKImageRef, WKArrayRef repaintRects); bool compareActualHashToExpectedAndDumpResults(const char[33]); + +#if PLATFORM(QT) + static void forceRepaintDoneCallback(WKErrorRef, void* context); + void forceRepaintDone(); +#endif WKRetainPtr<WKURLRef> m_url; std::string m_pathOrURL; @@ -61,6 +67,10 @@ private: bool m_gotFinalMessage; bool m_gotRepaint; bool m_error; + + WKRetainPtr<WKStringRef> m_textOutput; + WKRetainPtr<WKImageRef> m_pixelResult; + WKRetainPtr<WKArrayRef> m_repaintRects; }; } // namespace WTR diff --git a/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp b/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp index 1e53b0885..e11e6e74a 100644 --- a/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp +++ b/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp @@ -34,6 +34,7 @@ #include <QEventLoop> #include <QQmlProperty> #include <QtQuick/QQuickView> +#include <QtQuick/private/qquickwindow_p.h> #include <WebKit2/WKImageQt.h> #include <qpa/qwindowsysteminterface.h> @@ -61,6 +62,12 @@ private Q_SLOTS: m_view->setParentItem(rootObject()); QQmlProperty::write(m_view, "anchors.fill", qVariantFromValue(rootObject())); + if (PlatformWebView::windowShapshotEnabled()) { + setSurfaceType(OpenGLSurface); + create(); + QQuickWindowPrivate::get(this)->setRenderWithoutShowing(true); + } + QWindowSystemInterface::handleWindowActivated(this); m_view->page()->setFocus(true); } @@ -152,9 +159,16 @@ void PlatformWebView::makeWebViewFirstResponder() WKRetainPtr<WKImageRef> PlatformWebView::windowSnapshotImage() { - // FIXME: implement to capture pixels in the UI process, - // which may be necessary to capture things like 3D transforms. - return 0; + 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 diff --git a/Tools/WebKitTestRunner/qt/TestInvocationQt.cpp b/Tools/WebKitTestRunner/qt/TestInvocationQt.cpp index 981c2032a..0c231508e 100644 --- a/Tools/WebKitTestRunner/qt/TestInvocationQt.cpp +++ b/Tools/WebKitTestRunner/qt/TestInvocationQt.cpp @@ -27,6 +27,8 @@ #include "TestInvocation.h" +#include "PlatformWebView.h" +#include "TestController.h" #include <QBuffer> #include <QCryptographicHash> #include <QtGui/QPainter> @@ -63,9 +65,31 @@ static void dumpImage(const QImage& image) fflush(stdout); } +void TestInvocation::forceRepaintDoneCallback(WKErrorRef, void *context) +{ + static_cast<TestInvocation*>(context)->m_gotRepaint = true; + TestController::shared().notifyDone(); +} + void TestInvocation::dumpPixelsAndCompareWithExpected(WKImageRef imageRef, WKArrayRef repaintRects) { - QImage image = WKImageCreateQImage(imageRef); + QImage image; + if (PlatformWebView::windowShapshotEnabled()) { + WKPageRef page = TestController::shared().mainWebView()->page(); + WKPageForceRepaint(page, this, &forceRepaintDoneCallback); + + TestController::shared().runUntil(m_gotRepaint, TestController::ShortTimeout); + + 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()); diff --git a/Tools/qmake/mkspecs/features/default_pre.prf b/Tools/qmake/mkspecs/features/default_pre.prf index af25aa84b..a9cccb803 100644 --- a/Tools/qmake/mkspecs/features/default_pre.prf +++ b/Tools/qmake/mkspecs/features/default_pre.prf @@ -25,13 +25,7 @@ ROOT_WEBKIT_DIR = $$replace(PWD, /Tools/qmake/mkspecs/features$,) WEBKIT_SUBDIR = $$replace(_PRO_FILE_PWD_, $${ROOT_WEBKIT_DIR},) ROOT_BUILD_DIR = $$replace(OUT_PWD, $${WEBKIT_SUBDIR}$,) -# ### FIXME: Remove this after Qt 5 beta 2. Syncqt is not called from default_pre.prf -# anymore, so this was moved to api.pri. -# We want the QtWebKit API forwarding includes to live in the root build dir. -MODULE_BASE_DIR = $$ROOT_WEBKIT_DIR -MODULE_BASE_OUTDIR = $$ROOT_BUILD_DIR - -# The qmake files on the other hand live in a subdirectory. +# The qmake generated module files belong into our Tools/qmake dir MODULE_QMAKE_OUTDIR = $$ROOT_BUILD_DIR/Tools/qmake # Now we're ready to load default_pre from Qt diff --git a/Tools/qmake/mkspecs/features/production_build.prf b/Tools/qmake/mkspecs/features/production_build.prf index f5a4e69e3..b3f36abb4 100644 --- a/Tools/qmake/mkspecs/features/production_build.prf +++ b/Tools/qmake/mkspecs/features/production_build.prf @@ -7,9 +7,10 @@ CONFIG *= use_all_in_one_files # resulting in the need of several gigabytes of memory at link-time. Reduce the pressure # by compiling any static library like WTF or JSC with release flags instead and keep debug # symbols for the static libraries that implement API. -linux-*|win32-g++*:CONFIG(debug, debug|release):contains(TEMPLATE, lib):staticlib { +linux-*|win32-g++*:if(CONFIG(debug, debug|release)|contains(QT_CONFIG,separate_debug_info)):contains(TEMPLATE, lib):staticlib { !equals(TARGET, WebKit2):!equals(TARGET, WebKit1) { CONFIG += no_debug_info + CONFIG -= separate_debug_info QMAKE_CFLAGS += $$QMAKE_CFLAGS_RELEASE QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_RELEASE } diff --git a/Tools/qmake/mkspecs/features/unix/default_post.prf b/Tools/qmake/mkspecs/features/unix/default_post.prf index 92c073c53..5a73f17d4 100644 --- a/Tools/qmake/mkspecs/features/unix/default_post.prf +++ b/Tools/qmake/mkspecs/features/unix/default_post.prf @@ -34,7 +34,7 @@ linux-g++* { contains(TEMPLATE, app): CONFIG += rpath -isEqual(QT_ARCH,i386) { +isEqual(QT_ARCH,i386):CONFIG(debug, debug|release) { # Make ld not cache the symbol tables of input files in memory to avoid memory exhaustion during the linking phase. config_gnuld: QMAKE_LFLAGS += -Wl,--no-keep-memory } |
