| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/common/gpu/media/rendering_helper.h" | 5 #include "content/common/gpu/media/rendering_helper.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <numeric> | 10 #include <numeric> |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 ignore_vsync_ = true; | 268 ignore_vsync_ = true; |
| 269 #if defined(OS_CHROMEOS) | 269 #if defined(OS_CHROMEOS) |
| 270 // We hold onto the main loop here to wait for the DisplayController | 270 // We hold onto the main loop here to wait for the DisplayController |
| 271 // to give us the size of the display so we can create a window of | 271 // to give us the size of the display so we can create a window of |
| 272 // the same size. | 272 // the same size. |
| 273 base::RunLoop wait_display_setup; | 273 base::RunLoop wait_display_setup; |
| 274 DisplayConfiguratorObserver display_setup_observer(&wait_display_setup); | 274 DisplayConfiguratorObserver display_setup_observer(&wait_display_setup); |
| 275 display_configurator_.reset(new ui::DisplayConfigurator()); | 275 display_configurator_.reset(new ui::DisplayConfigurator()); |
| 276 display_configurator_->SetDelegateForTesting(0); | 276 display_configurator_->SetDelegateForTesting(0); |
| 277 display_configurator_->AddObserver(&display_setup_observer); | 277 display_configurator_->AddObserver(&display_setup_observer); |
| 278 display_configurator_->Init(true); | 278 display_configurator_->Init( |
| 279 ui::OzonePlatform::GetInstance()->CreateNativeDisplayDelegate(), |
| 280 true); |
| 279 display_configurator_->ForceInitialConfigure(0); | 281 display_configurator_->ForceInitialConfigure(0); |
| 280 // Make sure all the display configuration is applied. | 282 // Make sure all the display configuration is applied. |
| 281 wait_display_setup.Run(); | 283 wait_display_setup.Run(); |
| 282 display_configurator_->RemoveObserver(&display_setup_observer); | 284 display_configurator_->RemoveObserver(&display_setup_observer); |
| 283 | 285 |
| 284 gfx::Size framebuffer_size = display_configurator_->framebuffer_size(); | 286 gfx::Size framebuffer_size = display_configurator_->framebuffer_size(); |
| 285 if (!framebuffer_size.IsEmpty()) { | 287 if (!framebuffer_size.IsEmpty()) { |
| 286 window_size = framebuffer_size; | 288 window_size = framebuffer_size; |
| 287 ignore_vsync_ = false; | 289 ignore_vsync_ = false; |
| 288 } | 290 } |
| (...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 892 // When the rendering falls behind, drops frames. | 894 // When the rendering falls behind, drops frames. |
| 893 while (scheduled_render_time_ < target) { | 895 while (scheduled_render_time_ < target) { |
| 894 scheduled_render_time_ += frame_duration_; | 896 scheduled_render_time_ += frame_duration_; |
| 895 DropOneFrameForAllVideos(); | 897 DropOneFrameForAllVideos(); |
| 896 } | 898 } |
| 897 | 899 |
| 898 message_loop_->PostDelayedTask( | 900 message_loop_->PostDelayedTask( |
| 899 FROM_HERE, render_task_.callback(), target - now); | 901 FROM_HERE, render_task_.callback(), target - now); |
| 900 } | 902 } |
| 901 } // namespace content | 903 } // namespace content |
| OLD | NEW |