summaryrefslogtreecommitdiffstats
path: root/src/webengine/render_widget_host_view_qt_delegate_quick.h
diff options
context:
space:
mode:
authorJüri Valdmann <juri.valdmann@qt.io>2020-06-17 10:05:32 +0200
committerJüri Valdmann <juri.valdmann@qt.io>2020-07-06 16:30:11 +0200
commit08203aef3ab102bfb91928f37846b2b19a4540ee (patch)
treeb5b6be71629475e96c509e11e2b67644698588a3 /src/webengine/render_widget_host_view_qt_delegate_quick.h
parent45e3909e0fb628b6283fef8ea94861b7ca87093b (diff)
Move scenegraph handling out of core
Replace Display{Producer,Consumer,FrameSink} with the new classes Compositor and Compositor::Observer. The Compositor subclasses are implemented by the OutputSurfaces, replacing DisplayProducer in this role. Unlike DisplayProducer, the new classes do not use QtQuick scenegraph types, but rather give access to the software QImage or OpenGL texture directly. The connection to the "other half" is simplified by replacing DisplayConsumer with Compositor::Observer, which is no longer implemented by RenderWidgetHostViewQt, but directly by its delegates in the quick and widgets libraries. RenderWidgetHostViewQt now only provides the delegate with a Compositor::Id which is used to connect the corresponding Compositor and Observer. The delegates are responsible for generating QtQuick scenegraph nodes from the information provided by the Compositor subclasses. Behavior with software and old OpenGL scenegraph backends is unchanged: both continue to work. As for the RHI scenegraph backend, the code here is correct but nonetheless not working: changes are needed in qtbase to make RHI use the global share context for its OpenGL context. Fixes: QTBUG-78682 Change-Id: I837da8860a18ec366ed33f6ecc44c147245e1101 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'src/webengine/render_widget_host_view_qt_delegate_quick.h')
-rw-r--r--src/webengine/render_widget_host_view_qt_delegate_quick.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/webengine/render_widget_host_view_qt_delegate_quick.h b/src/webengine/render_widget_host_view_qt_delegate_quick.h
index feea10017..cb38ebd20 100644
--- a/src/webengine/render_widget_host_view_qt_delegate_quick.h
+++ b/src/webengine/render_widget_host_view_qt_delegate_quick.h
@@ -40,6 +40,7 @@
#ifndef RENDER_WIDGET_HOST_VIEW_QT_DELEGATE_QUICK_H
#define RENDER_WIDGET_HOST_VIEW_QT_DELEGATE_QUICK_H
+#include "compositor/compositor.h"
#include "render_widget_host_view_qt_delegate.h"
#include <QAccessibleObject>
@@ -55,7 +56,9 @@ namespace QtWebEngineCore {
class RenderWidgetHostViewQtDelegateClient;
-class RenderWidgetHostViewQtDelegateQuick : public QQuickItem, public RenderWidgetHostViewQtDelegate
+class RenderWidgetHostViewQtDelegateQuick : public QQuickItem,
+ public RenderWidgetHostViewQtDelegate,
+ public Compositor::Observer
{
Q_OBJECT
public:
@@ -73,11 +76,6 @@ public:
void hide() override;
bool isVisible() const override;
QWindow* window() const override;
- QSGTexture *createTextureFromImage(const QImage &) override;
- QSGLayer *createLayer() override;
- QSGImageNode *createImageNode() override;
- QSGRectangleNode *createRectangleNode() override;
- void update() override;
void updateCursor(const QCursor &) override;
void resize(int width, int height) override;
void move(const QPoint&) override { }
@@ -87,6 +85,8 @@ public:
void setClearColor(const QColor &) override { }
bool copySurface(const QRect &rect, const QSize &size, QImage &image) override;
+ void readyToSwap() override;
+
protected:
bool event(QEvent *event) override;
void focusInEvent(QFocusEvent *event) override;
@@ -107,6 +107,7 @@ protected:
QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override;
private slots:
+ void onBeforeRendering();
void onWindowPosChanged();
void onHide();