diff --git a/sky/shell/gpu/direct/rasterizer_direct.cc b/sky/shell/gpu/direct/rasterizer_direct.cc index 353f35bfdeb5ab47991621998f51a2723448e221..8581d427a604e2d578ba6a4f207730411f68a87f 100644 --- a/sky/shell/gpu/direct/rasterizer_direct.cc +++ b/sky/shell/gpu/direct/rasterizer_direct.cc @@ -53,6 +53,11 @@ void RasterizerDirect::OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widge surface_ = gfx::GLSurface::CreateViewGLSurface(widget, gfx::SurfaceConfiguration()); CHECK(surface_) << "GLSurface required."; + // Eagerly create the GL context. For a while after the accelerated widget + // is first available (after startup), the process is busy setting up dart + // isolates. During this time, we are free to create the context. Thus + // avoiding a delay when the first frame is painted. + EnsureGLContext(); } void RasterizerDirect::Draw(uint64_t layer_tree_ptr,