Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(615)

Unified Diff: sky/compositor/layer_host.cc

Issue 759763002: Fix DCHECK(gr_texture) when running test_sky (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/skia/ganesh_surface.cc ('k') | sky/compositor/resource_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/compositor/layer_host.cc
diff --git a/sky/compositor/layer_host.cc b/sky/compositor/layer_host.cc
index ef6b543cd97ec7abccabaa69901eb74d975e74f3..50fc24b7e48919d81555e018d64c766300e3c336 100644
--- a/sky/compositor/layer_host.cc
+++ b/sky/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();
« no previous file with comments | « mojo/skia/ganesh_surface.cc ('k') | sky/compositor/resource_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698