From 44429c06ebf7385d337ad0bcdf24d04801fdfd36 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Wed, 25 May 2016 17:45:40 -0700 Subject: [PATCH] Clear the background during load (#2710) Previously we'd draw uninitialized memory. Now we draw black. Fixes #3447 --- sky/shell/gpu/direct/rasterizer_direct.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sky/shell/gpu/direct/rasterizer_direct.cc b/sky/shell/gpu/direct/rasterizer_direct.cc index 5312fc4410f..1e66e006b25 100644 --- a/sky/shell/gpu/direct/rasterizer_direct.cc +++ b/sky/shell/gpu/direct/rasterizer_direct.cc @@ -62,6 +62,10 @@ void RasterizerDirect::OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widge // isolates. During this time, we are free to create the context. Thus // avoiding a delay when the first frame is painted. EnsureGLContext(); + CHECK(context_->MakeCurrent(surface_.get())); + glClearColor(0.0f, 0.0f, 0.0f, 1.0f); + glClear(GL_COLOR_BUFFER_BIT); + surface_->SwapBuffers(); } void RasterizerDirect::Draw(uint64_t layer_tree_ptr,