summaryrefslogtreecommitdiffstats
path: root/lib/quick/render_widget_host_view_qt_delegate_quick.cpp
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2013-09-13 15:29:53 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-14 15:50:35 +0200
commit0b9ea2d05d1081ce4a667f0c7036a205bcd751a3 (patch)
tree3d194274878b1501bbe15428554d74aedafd0d56 /lib/quick/render_widget_host_view_qt_delegate_quick.cpp
parent338e24b48601a3cfdcde0977b6c9390d33d51c9f (diff)
Render delegated renderer frames using the Qt scene graph.
This provides a stub implementation that renders quads and RenderPasses using QSGNodes in QQuickWebEngineView. The BackingStore code path is still supported when the delegated renderer switch is not enabled. To use the new rendering, pass the following switches: --enable-delegated-renderer --enable-threaded-compositing This uses debug, plain color textures until we can fetch tiles and textures from the ResourceProvider across OpenGL context boundaries. Change-Id: I33ea0738dc5a326ef79c1435f75c044c42e8551f Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
Diffstat (limited to 'lib/quick/render_widget_host_view_qt_delegate_quick.cpp')
-rw-r--r--lib/quick/render_widget_host_view_qt_delegate_quick.cpp28
1 files changed, 25 insertions, 3 deletions
diff --git a/lib/quick/render_widget_host_view_qt_delegate_quick.cpp b/lib/quick/render_widget_host_view_qt_delegate_quick.cpp
index 6f8243690..b77503f2c 100644
--- a/lib/quick/render_widget_host_view_qt_delegate_quick.cpp
+++ b/lib/quick/render_widget_host_view_qt_delegate_quick.cpp
@@ -41,6 +41,30 @@
#include "render_widget_host_view_qt_delegate_quick.h"
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0))
+RenderWidgetHostViewQtDelegateQuick::RenderWidgetHostViewQtDelegateQuick(QQuickItem *parent)
+ : RenderWidgetHostViewQtDelegateQuickBase<QQuickItem>(parent)
+{
+ setFlag(ItemHasContents);
+}
+
+WId RenderWidgetHostViewQtDelegateQuick::nativeWindowIdForCompositor() const
+{
+ return QQuickItem::window()->winId();
+}
+
+void RenderWidgetHostViewQtDelegateQuick::update(const QRect&)
+{
+ QQuickItem::update();
+}
+
+QSGNode *RenderWidgetHostViewQtDelegateQuick::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *)
+{
+ return RenderWidgetHostViewQtDelegate::updatePaintNode(oldNode, QQuickItem::window());
+}
+#endif // QT_VERSION
+
+
RenderWidgetHostViewQtDelegateQuickPainted::RenderWidgetHostViewQtDelegateQuickPainted(QQuickItem *parent)
: RenderWidgetHostViewQtDelegateQuickBase<QQuickPaintedItem>(parent)
{
@@ -48,9 +72,7 @@ RenderWidgetHostViewQtDelegateQuickPainted::RenderWidgetHostViewQtDelegateQuickP
WId RenderWidgetHostViewQtDelegateQuickPainted::nativeWindowIdForCompositor() const
{
- // Only used to enable accelerated compositing by the compositor
- // directly on our native window, which we want to eventually do
- // through the delegated renderer instead.
+ // This causes a failure of the compositor initialization which ends up disabling it completely.
return 0;
}