summaryrefslogtreecommitdiff
path: root/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-10-18 14:10:51 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2012-10-18 14:10:51 +0200
commitd9cf437c840c6eb7417bdd97e6c40979255d3158 (patch)
treea231782c949300763457407149cfd84c20e0222e /Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp
parentee4c86d1990a9e26277a6948e7027ad8d525ebfa (diff)
downloadqtwebkit-d9cf437c840c6eb7417bdd97e6c40979255d3158.tar.gz
Imported WebKit commit a1c73566da3265b6c5dc815a24b0e5ab02d2c885 (http://svn.webkit.org/repository/webkit/trunk@131728)
New snapshot with a better fix for the out-of-memory at link time situation.
Diffstat (limited to 'Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp')
-rw-r--r--Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp20
1 files changed, 17 insertions, 3 deletions
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