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

Unified Diff: ui/compositor/compositor.cc

Issue 2238693002: Plumb SetVisible from ui::Compositor to the DirectRenderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: setvisible-browser: onemore Created 4 years, 4 months 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 | « ui/compositor/compositor.h ('k') | ui/compositor/layer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « ui/compositor/compositor.h ('k') | ui/compositor/layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698