diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp index 8bd4ac0a7f20a..6b7ec4eb8a3ec 100644 --- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp +++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp @@ -84,6 +84,8 @@ LayerTreeHost::LayerTreeHost(WebPage& webPage) m_layerTreeContext.contextID = m_surface->surfaceID(); didChangeViewport(); + + initialized.store(true); } LayerTreeHost::~LayerTreeHost() @@ -394,7 +396,9 @@ void LayerTreeHost::updateScene() void LayerTreeHost::frameComplete() { - m_compositor->frameComplete(); + if (initialized.load()) { + m_compositor->frameComplete(); + } } uint64_t LayerTreeHost::nativeSurfaceHandleForCompositing() diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h index f06382c5b5d3b..076a3979bb3f6 100644 --- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h +++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h @@ -37,6 +37,7 @@ #include #include #include +#include #if USE(GRAPHICS_LAYER_TEXTURE_MAPPER) @@ -220,6 +221,7 @@ class LayerTreeHost double m_transientZoomScale { 1 }; WebCore::FloatPoint m_transientZoomOrigin; #endif + std::atomic_bool initialized { false }; }; #if !USE(COORDINATED_GRAPHICS)