Index: content/common/gpu/media/rendering_helper.cc |
diff --git a/content/common/gpu/media/rendering_helper.cc b/content/common/gpu/media/rendering_helper.cc |
index 950ae6e71dd07e3eb0a41739e695cab20a9e4825..22ee1c14ff9d4af9473b9c5277de3c3055bddd37 100644 |
--- a/content/common/gpu/media/rendering_helper.cc |
+++ b/content/common/gpu/media/rendering_helper.cc |
@@ -13,6 +13,7 @@ |
#include "base/command_line.h" |
#include "base/mac/scoped_nsautorelease_pool.h" |
#include "base/message_loop/message_loop.h" |
+#include "base/run_loop.h" |
#include "base/strings/stringize_macros.h" |
#include "base/synchronization/waitable_event.h" |
#include "base/time/time.h" |
@@ -39,6 +40,7 @@ |
#if defined(USE_OZONE) |
#if defined(OS_CHROMEOS) |
#include "ui/display/chromeos/display_configurator.h" |
+#include "ui/display/types/display_constants.h" |
#endif // defined(OS_CHROMEOS) |
#include "ui/ozone/public/ozone_platform.h" |
#include "ui/ozone/public/ui_thread_gpu.h" |
@@ -232,14 +234,26 @@ void RenderingHelper::Initialize(const RenderingHelperParams& params, |
platform_window_delegate_.reset(new RenderingHelper::StubOzoneDelegate()); |
window_ = platform_window_delegate_->accelerated_widget(); |
#if defined(OS_CHROMEOS) |
- display_configurator_.reset(new ui::DisplayConfigurator()); |
+ // We hold onto the main loop here to wait for the DisplayController |
+ // to give us the size of the display so we can create a window of |
+ // the same size. |
+ base::MessageLoop::ScopedNestableTaskAllower nest_loop( |
dnicoara
2015/01/21 19:21:35
You shouldn't need this anymore.
llandwerlin-old
2015/01/22 11:03:18
Acknowledged.
|
+ base::MessageLoop::current()); |
+ display_configurator_.reset(new ui::DisplayConfigurator); |
display_configurator_->Init(true); |
display_configurator_->ForceInitialConfigure(0); |
+ // Make sure all the display configuration is applied. |
+ base::RunLoop().RunUntilIdle(); |
Owen Lin
2015/01/22 03:46:44
The correctness of using "RunUntilIdle()" here is
llandwerlin-old
2015/01/22 11:03:18
I agree, posting a message to a different thread a
|
+ display_configurator_->SetDisplayMode(ui::MULTIPLE_DISPLAY_STATE_SINGLE); |
+ // Make sure all the display configuration is applied. |
+ base::RunLoop().RunUntilIdle(); |
platform_window_delegate_->platform_window()->SetBounds( |
gfx::Rect(display_configurator_->framebuffer_size())); |
#else |
platform_window_delegate_->platform_window()->SetBounds(gfx::Rect(800, 600)); |
#endif |
+ // Wait for the window to be resized. |
+ base::RunLoop().RunUntilIdle(); |
#else |
#error unknown platform |
#endif |