From 426d193ca6bb4b8949c97ee484055c0ef2e1e68e Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Tue, 25 Nov 2014 12:11:59 -0800 Subject: [PATCH] Fix DCHECK(gr_texture) when running test_sky We shouldn't bother trying to draw a 0x0 sky::Layer. It makes Ganesh unhappy. R=ojan@chromium.org Review URL: https://codereview.chromium.org/759763002 --- compositor/layer_host.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/compositor/layer_host.cc b/compositor/layer_host.cc index ef6b543cd97..50fc24b7e48 100644 --- a/compositor/layer_host.cc +++ b/compositor/layer_host.cc @@ -75,6 +75,16 @@ void LayerHost::BeginFrame() { client_->BeginFrame(base::TimeTicks::Now()); + // If the root layer is empty, there's no reason to draw into it. (In fact, + // Ganesh will get upset if we try.) Instead, we just schedule the ack that + // the frame is complete. + if (root_layer_->size().IsEmpty()) { + base::MessageLoop::current()->PostTask( + FROM_HERE, + base::Bind(&LayerHost::DidCompleteFrame, weak_factory_.GetWeakPtr())); + return; + } + { mojo::GaneshContext::Scope scope(&ganesh_context_); ganesh_context_.gr()->resetContext();