diff options
author | Jüri Valdmann <juri.valdmann@qt.io> | 2020-06-17 10:05:32 +0200 |
---|---|---|
committer | Jüri Valdmann <juri.valdmann@qt.io> | 2020-07-06 16:30:11 +0200 |
commit | 08203aef3ab102bfb91928f37846b2b19a4540ee (patch) | |
tree | b5b6be71629475e96c509e11e2b67644698588a3 /src/core/render_widget_host_view_qt.h | |
parent | 45e3909e0fb628b6283fef8ea94861b7ca87093b (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/core/render_widget_host_view_qt.h')
-rw-r--r-- | src/core/render_widget_host_view_qt.h | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/src/core/render_widget_host_view_qt.h b/src/core/render_widget_host_view_qt.h index 42c44b007..7ed01f424 100644 --- a/src/core/render_widget_host_view_qt.h +++ b/src/core/render_widget_host_view_qt.h @@ -40,7 +40,7 @@ #ifndef RENDER_WIDGET_HOST_VIEW_QT_H #define RENDER_WIDGET_HOST_VIEW_QT_H -#include "compositor/display_frame_sink.h" +#include "compositor/compositor.h" #include "delegated_frame_host_client_qt.h" #include "render_widget_host_view_qt_delegate.h" @@ -81,15 +81,8 @@ class RenderWidgetHostViewQt , public ui::GestureProviderClient , public base::SupportsWeakPtr<RenderWidgetHostViewQt> , public content::TextInputManager::Observer - , public DisplayConsumer { public: - enum LoadVisuallyCommittedState { - NotCommitted, - DidFirstVisuallyNonEmptyPaint, - DidFirstCompositorFrameSwap - }; - RenderWidgetHostViewQt(content::RenderWidgetHost* widget); ~RenderWidgetHostViewQt(); @@ -172,11 +165,8 @@ public: // Overridden from content::RenderFrameMetadataProvider::Observer void OnRenderFrameMetadataChangedAfterActivation() override; - // Overridden from DisplayConsumer - void scheduleUpdate() override; - // Called from RenderWidgetHostViewQtDelegateClient. - QSGNode *updatePaintNode(QSGNode *); + Compositor::Id compositorId(); void notifyShown(); void notifyHidden(); bool updateScreenInfo(); @@ -205,7 +195,6 @@ private: bool isPopup() const; content::RenderFrameHost *getFocusedFrameHost(); - void callUpdate(); scoped_refptr<base::SingleThreadTaskRunner> m_taskRunner; ui::FilteredGestureProvider m_gestureProvider; @@ -221,14 +210,12 @@ private: gfx::Vector2dF m_lastScrollOffset; gfx::SizeF m_lastContentsSize; DelegatedFrameHostClientQt m_delegatedFrameHostClient { this }; - LoadVisuallyCommittedState m_loadVisuallyCommittedState = NotCommitted; // VIZ content::ScreenInfo m_screenInfo; std::unique_ptr<content::DelegatedFrameHost> m_delegatedFrameHost; std::unique_ptr<ui::Layer> m_rootLayer; std::unique_ptr<ui::Compositor> m_uiCompositor; - scoped_refptr<DisplayFrameSink> m_displayFrameSink; viz::ParentLocalSurfaceIdAllocator m_dfhLocalSurfaceIdAllocator; viz::ParentLocalSurfaceIdAllocator m_uiCompositorLocalSurfaceIdAllocator; |