From ae0eea6d5dbbe8570ff5ee2342484a78ad5c92fb Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 15 Oct 2019 18:26:37 +0200 Subject: Handle possible frame eviction on show MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/core/render_widget_host_view_qt.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/core/render_widget_host_view_qt.cpp') 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() -- cgit v1.2.3