diff --git a/engine/src/flutter/compositor/layer.cc b/engine/src/flutter/compositor/layer.cc index f138905e3f..7631db72c2 100644 --- a/engine/src/flutter/compositor/layer.cc +++ b/engine/src/flutter/compositor/layer.cc @@ -27,7 +27,6 @@ void Layer::SetSize(const gfx::Size& size) { void Layer::Display() { DCHECK(host_); - mojo::GaneshContext::Scope scope(host_->ganesh_context()); mojo::GaneshSurface surface(host_->ganesh_context(), host_->resource_manager()->CreateTexture(size_)); diff --git a/engine/src/flutter/compositor/layer_host.cc b/engine/src/flutter/compositor/layer_host.cc index a00dbd98c1..a1991770c3 100644 --- a/engine/src/flutter/compositor/layer_host.cc +++ b/engine/src/flutter/compositor/layer_host.cc @@ -49,7 +49,13 @@ void LayerHost::ReturnResources( void LayerHost::BeginFrame(base::TimeTicks frame_time, base::TimeTicks deadline) { client_->BeginFrame(frame_time); - root_layer_->Display(); + + { + mojo::GaneshContext::Scope scope(&ganesh_context_); + ganesh_context_.gr()->resetContext(); + root_layer_->Display(); + } + Upload(root_layer_.get()); }