Chromium Code Reviews| 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_) |