diff --git a/compositor/layer.cc b/compositor/layer.cc index f138905e3f8..7631db72c2d 100644 --- a/compositor/layer.cc +++ b/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/compositor/layer_host.cc b/compositor/layer_host.cc index a00dbd98c19..a1991770c3b 100644 --- a/compositor/layer_host.cc +++ b/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()); } diff --git a/viewer/document_view.cc b/viewer/document_view.cc index 9b740332763..07102676ec8 100644 --- a/viewer/document_view.cc +++ b/viewer/document_view.cc @@ -171,7 +171,7 @@ blink::WebLayerTreeView* DocumentView::initializeLayerTreeView() { #if ENABLE_SKY_COMPOSITOR mojo::Shell* DocumentView::GetShell() { - return shell_.get(); + return shell_; } void DocumentView::BeginFrame(base::TimeTicks frame_time) { diff --git a/viewer/document_view.h b/viewer/document_view.h index ff72208b616..a5b0e14e838 100644 --- a/viewer/document_view.h +++ b/viewer/document_view.h @@ -25,7 +25,7 @@ #include "sky/viewer/services/inspector_impl.h" // You can try enabling the Sky compositor, but it's a bit buggy. -#define ENABLE_SKY_COMPOSITOR 0 +#define ENABLE_SKY_COMPOSITOR 1 namespace base { class MessageLoopProxy;