diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-10-15 18:26:37 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-10-16 14:46:50 +0200 |
commit | ae0eea6d5dbbe8570ff5ee2342484a78ad5c92fb (patch) | |
tree | 7f2ca486bc9d4c2871c7271cb0c215242c1f27e1 | |
parent | af00406114d8ad797543d9ad08c057c0bb96e8cf (diff) |
Handle possible frame eviction on show
Our surface id might have been invalidated, so we need to generate a
new one. And DelegatedFrameHost::WasShown needs to be called after
RenderWidgetHostImpl::WasShown which cancels the eviction.
Change-Id: I5761d47b11754a77e40ebde7fc5ed2e64f372613
Fixes: QTBUG-79021
Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
-rw-r--r-- | src/core/render_widget_host_view_qt.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index 7633aa44c..e86f05d60 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -1009,15 +1009,22 @@ QSGNode *RenderWidgetHostViewQt::updatePaintNode(QSGNode *oldNode) void RenderWidgetHostViewQt::notifyShown() { if (m_enableViz) { + // Handle possible frame eviction: + if (!m_dfhLocalSurfaceIdAllocator.HasValidLocalSurfaceIdAllocation()) + m_dfhLocalSurfaceIdAllocator.GenerateId(); if (m_visible) return; m_visible = true; + } + + host()->WasShown(base::nullopt); + + if (m_enableViz) { m_delegatedFrameHost->AttachToCompositor(m_uiCompositor.get()); m_delegatedFrameHost->WasShown(GetLocalSurfaceIdAllocation().local_surface_id(), m_viewRectInDips.size(), base::nullopt); } - host()->WasShown(base::nullopt); } void RenderWidgetHostViewQt::notifyHidden() |