summaryrefslogtreecommitdiffstats
path: root/src/core/render_widget_host_view_qt.cpp
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2016-11-24 15:02:34 +0100
committerPeter Varga <pvarga@inf.u-szeged.hu>2016-11-25 13:10:44 +0000
commit9894a46ced4e760a90b8e0508ca1452f5d2fd7ef (patch)
treeca983d2d0b3d2153b31bdda591893b6f2bf99700 /src/core/render_widget_host_view_qt.cpp
parent5bd02ef363a7fcfdb0c34dcd75938c54163bf10f (diff)
Rework and fix loadVisuallyCommitted signal
- Remove RenderViewObserverHostQt_DidFirstVisuallyNonEmptyLayout message and use WebContentsObserver::DidFirstVisuallyNonEmptyPaint instead. - The order of the DidFirstVisuallyNonEmptyPaint and OnSwapCompositorFrame events is not guaranteed. Check for both events to do not miss to send any loadVisuallyCommitted signal. Change-Id: Ic733b3e9a6fae64b1d827e8e07514f180273cf8c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/render_widget_host_view_qt.cpp')
-rw-r--r--src/core/render_widget_host_view_qt.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index 097dda1cd..70ffe0dcb 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -236,7 +236,7 @@ RenderWidgetHostViewQt::RenderWidgetHostViewQt(content::RenderWidgetHost* widget
, m_touchMotionStarted(false)
, m_chromiumCompositorData(new ChromiumCompositorData)
, m_needsDelegatedFrameAck(false)
- , m_didFirstVisuallyNonEmptyLayout(false)
+ , m_loadVisuallyCommittedState(NotCommitted)
, m_adapterClient(0)
, m_imeInProgress(false)
, m_receivedEmptyImeText(false)
@@ -676,9 +676,11 @@ void RenderWidgetHostViewQt::OnSwapCompositorFrame(uint32_t output_surface_id, c
m_delegate->update();
- if (m_didFirstVisuallyNonEmptyLayout) {
+ if (m_loadVisuallyCommittedState == NotCommitted) {
+ m_loadVisuallyCommittedState = DidFirstCompositorFrameSwap;
+ } else if (m_loadVisuallyCommittedState == DidFirstVisuallyNonEmptyPaint) {
m_adapterClient->loadVisuallyCommitted();
- m_didFirstVisuallyNonEmptyLayout = false;
+ m_loadVisuallyCommittedState = NotCommitted;
}
if (scrollOffsetChanged)
@@ -1244,9 +1246,4 @@ void RenderWidgetHostViewQt::handleFocusEvent(QFocusEvent *ev)
}
}
-void RenderWidgetHostViewQt::didFirstVisuallyNonEmptyLayout()
-{
- m_didFirstVisuallyNonEmptyLayout = true;
-}
-
} // namespace QtWebEngineCore