Title: [131726] trunk/Tools
- Revision
- 131726
- Author
- kbal...@webkit.org
- Date
- 2012-10-18 04:26:27 -0700 (Thu, 18 Oct 2012)
Log Message
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):
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (131725 => 131726)
--- trunk/Tools/ChangeLog 2012-10-18 11:26:07 UTC (rev 131725)
+++ trunk/Tools/ChangeLog 2012-10-18 11:26:27 UTC (rev 131726)
@@ -1,5 +1,24 @@
2012-10-15 Balazs Kelemen <kbal...@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 <kbal...@webkit.org>
+
[Qt][WTR] Do a forced repaint before generating pixel results
https://bugs.webkit.org/show_bug.cgi?id=98654
Modified: trunk/Tools/WebKitTestRunner/Target.pri (131725 => 131726)
--- trunk/Tools/WebKitTestRunner/Target.pri 2012-10-18 11:26:07 UTC (rev 131725)
+++ trunk/Tools/WebKitTestRunner/Target.pri 2012-10-18 11:26:27 UTC (rev 131726)
@@ -33,7 +33,7 @@
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 _javascript_core webkit2
Modified: trunk/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp (131725 => 131726)
--- trunk/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp 2012-10-18 11:26:07 UTC (rev 131725)
+++ trunk/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp 2012-10-18 11:26:27 UTC (rev 131726)
@@ -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,11 @@
m_view->setParentItem(rootObject());
QQmlProperty::write(m_view, "anchors.fill", qVariantFromValue(rootObject()));
+ setSurfaceType(OpenGLSurface);
+ create();
+
+ QQuickWindowPrivate::get(this)->setRenderWithoutShowing(true);
+
QWindowSystemInterface::handleWindowActivated(this);
m_view->page()->setFocus(true);
}
@@ -152,9 +158,7 @@
WKRetainPtr<WKImageRef> PlatformWebView::windowSnapshotImage()
{
- // FIXME: implement to capture pixels in the UI process,
- // which may be necessary to capture things like 3D transforms.
- return adoptWK(WKImageCreateFromQImage(QImage()));
+ return adoptWK(WKImageCreateFromQImage(m_window->grabWindow()));
}
} // namespace WTR
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes