Index: ui/compositor/compositor.cc |
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc |
index 19c43ce2af45fabed5f6895b9bc119b89c107236..a1f3fbc855fdf3ccedace1d4b9d43b3c3b4865b8 100644 |
--- a/ui/compositor/compositor.cc |
+++ b/ui/compositor/compositor.cc |
@@ -301,6 +301,9 @@ void Compositor::SetOutputSurface( |
surface_id_allocator_->client_id(), client.first); |
client.second = surface_id_allocator_->client_id(); |
} |
+ // Visibility is reset when the output surface is lost, so update it to match |
+ // the Compositor's. |
+ context_factory_->SetDisplayVisible(this, host_->visible()); |
} |
void Compositor::ScheduleDraw() { |
@@ -379,6 +382,9 @@ void Compositor::SetBackgroundColor(SkColor color) { |
void Compositor::SetVisible(bool visible) { |
host_->SetVisible(visible); |
+ // Visibility is reset when the output surface is lost, so this must also be |
+ // updated then. |
+ context_factory_->SetDisplayVisible(this, visible); |
} |
bool Compositor::IsVisible() { |
@@ -502,8 +508,9 @@ void Compositor::UpdateLayerTreeHost() { |
void Compositor::RequestNewOutputSurface() { |
DCHECK(!output_surface_requested_); |
output_surface_requested_ = true; |
- if (widget_valid_) |
+ if (widget_valid_) { |
context_factory_->CreateOutputSurface(weak_ptr_factory_.GetWeakPtr()); |
+ } |
} |
void Compositor::DidInitializeOutputSurface() { |