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

Unified Diff: ui/display/chromeos/display_configurator.cc

Issue 1024943003: Don't update framebuffer_size to 0x0 when the framebuffer size didn't change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | « no previous file | ui/display/chromeos/display_configurator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/chromeos/display_configurator.cc
diff --git a/ui/display/chromeos/display_configurator.cc b/ui/display/chromeos/display_configurator.cc
index 5e8bccf328b514c3a29b1c3e653e46b23cf2cf02..9ead66156fb6165fb2f20262f31107dee10cedd6 100644
--- a/ui/display/chromeos/display_configurator.cc
+++ b/ui/display/chromeos/display_configurator.cc
@@ -323,7 +323,8 @@ bool DisplayConfigurator::DisplayLayoutManagerImpl::GetDisplayLayout(
break;
}
}
-
+ DCHECK(new_display_state == MULTIPLE_DISPLAY_STATE_HEADLESS ||
+ !size.IsEmpty());
*framebuffer_size = size;
return true;
}
@@ -919,7 +920,17 @@ void DisplayConfigurator::OnConfigured(
if (success) {
current_display_state_ = new_display_state;
current_power_state_ = new_power_state;
- framebuffer_size_ = framebuffer_size;
+
+ // |framebuffer_size| is empty in software mirroring mode, headless mode,
+ // or all displays are off.
+ DCHECK(!framebuffer_size.IsEmpty() ||
+ mirroring_controller_->SoftwareMirroringEnabled() ||
+ new_display_state == MULTIPLE_DISPLAY_STATE_HEADLESS ||
+ new_power_state == chromeos::DISPLAY_POWER_ALL_OFF);
dnicoara 2015/03/20 18:36:42 Shouldn't happen when the display power is all off
oshima 2015/03/20 20:30:08 when suspending display(s), it may skip actual con
dnicoara 2015/03/20 20:37:36 Acknowledged.
+
+ if (!framebuffer_size.IsEmpty())
+ framebuffer_size_ = framebuffer_size;
+
// If the requested power state hasn't changed then make sure that value
// gets updated as well since the last requested value may have been
// dependent on certain conditions (ie: if only the internal monitor was
« no previous file with comments | « no previous file | ui/display/chromeos/display_configurator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698