summaryrefslogtreecommitdiffstats
path: root/lib/widgets
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2013-07-26 15:08:30 +0200
committerJocelyn Turcotte <jocelyn.turcotte@digia.com>2013-08-01 12:20:25 +0200
commit6bce05748e7ff25f2e487357e3fa40b5943ec664 (patch)
tree45ed8a7c030ffa0bda8a1a6d205919f4127fbeee /lib/widgets
parentdf4a06d291ce8a338c2bd83b9e7e27c67421b199 (diff)
Enable accelerated composition with QtWidgets view for testing.
Only enable it when the --force-compositing-mode switch is used. The purpose of this is only to allow testing pinch-zooming until we are able to use the delegated renderer in the QtQuick view. Change-Id: I2ca265c84c8fe6a74299f1b2757ad525f33fae17 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com> Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
Diffstat (limited to 'lib/widgets')
-rw-r--r--lib/widgets/render_widget_host_view_qt_delegate_widget.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/widgets/render_widget_host_view_qt_delegate_widget.cpp b/lib/widgets/render_widget_host_view_qt_delegate_widget.cpp
index d90190edb..ee6d553c9 100644
--- a/lib/widgets/render_widget_host_view_qt_delegate_widget.cpp
+++ b/lib/widgets/render_widget_host_view_qt_delegate_widget.cpp
@@ -41,6 +41,7 @@
#include "render_widget_host_view_qt_delegate_widget.h"
+#include <QtGlobal>
#include <QResizeEvent>
#include <QPainter>
#include <QPaintEvent>
@@ -51,6 +52,21 @@ RenderWidgetHostViewQtDelegateWidget::RenderWidgetHostViewQtDelegateWidget(QWidg
setFocusPolicy(Qt::ClickFocus);
setAttribute(Qt::WA_AcceptTouchEvents);
setAttribute(Qt::WA_OpaquePaintEvent);
+
+#if defined(Q_OS_LINUX)
+ // FOR TESTING ONLY, use at your own risks.
+ // Supporting this properly on all platforms would require duplicating
+ // many tricks done by RenderWidgetHostView[Win|Mac].
+ if (isCompositingModeForced()) {
+ // This sets Qt::WA_NativeWindow and force a native window creation
+ // that we can give to the GPU process for it to render directly
+ // on through windowHandle().
+ winId();
+ // This makes sure that we won't try to paint the regular backing store
+ // on the window at the same time as the compositor.
+ setUpdatesEnabled(false);
+ }
+#endif
}
QRectF RenderWidgetHostViewQtDelegateWidget::screenRect() const