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

Unified Diff: chromeos/display/output_configurator.cc

Issue 12079002: Minimize black screen during the boot with multi displays (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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
Index: chromeos/display/output_configurator.cc
diff --git a/chromeos/display/output_configurator.cc b/chromeos/display/output_configurator.cc
index ddfb003c0637a10023b75eab5316d7e61cffe89d..5d316c4c1631fed87e7069982be81cc004458d98 100644
--- a/chromeos/display/output_configurator.cc
+++ b/chromeos/display/output_configurator.cc
@@ -534,7 +534,12 @@ OutputConfigurator::OutputConfigurator()
last_enter_state_time_() {
}
-void OutputConfigurator::Init(bool is_panel_fitting_enabled) {
+OutputConfigurator::~OutputConfigurator() {
+ RecordPreviousStateUMA();
+}
+
+void OutputConfigurator::Init(bool is_panel_fitting_enabled,
+ bool is_first_run_after_boot) {
if (!is_running_on_chrome_os_)
return;
@@ -551,6 +556,25 @@ void OutputConfigurator::Init(bool is_panel_fitting_enabled) {
// Detect our initial state.
std::vector<OutputSnapshot> outputs = GetDualOutputs(display, screen);
connected_output_count_ = outputs.size();
+
+ if (is_first_run_after_boot && outputs.size() > 1) {
+ // Configuring the CRTC/Framebuffer clears the boot screen image.
+ // Set the same background color (0xfefefe) while configuring the
+ // display to minimize the duration of black screen at boot
+ // time. The background will be removed when
+ // aura::RootWindowHostLinux is created.
+ // crbug.com/171050.
+ XColor color;
+ Colormap colormap = DefaultColormap(display, 0);
+ char chromeos_backcolor[] = "#FEFEFE";
Daniel Erat 2013/01/26 15:52:30 don't hardcode this here; i think it's defined as
oshima 2013/01/26 23:10:42 I couldn't find one for sharing, but found this on
+ XParseColor(display, colormap, chromeos_backcolor, &color);
+ XAllocColor(display, colormap, &color);
+ XSetWindowAttributes swa = {0};
+ swa.background_pixel = color.pixel;
+ XChangeWindowAttributes(display, window, CWBackPixel, &swa);
+ XFreeColors(display, colormap, &color.pixel, 1, 0);
+ }
+
output_state_ = InferCurrentState(display, screen, outputs);
// Ensure that we are in a supported state with all connected displays powered
// on.
@@ -585,10 +609,6 @@ void OutputConfigurator::Init(bool is_panel_fitting_enabled) {
SetIsProjecting(is_projecting);
}
-OutputConfigurator::~OutputConfigurator() {
- RecordPreviousStateUMA();
-}
-
bool OutputConfigurator::CycleDisplayMode() {
VLOG(1) << "CycleDisplayMode";
if (!is_running_on_chrome_os_)
« ash/display/display_change_observer_x11.cc ('K') | « chromeos/display/output_configurator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698