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

Side by Side Diff: content/common/gpu/media/rendering_helper.cc

Issue 1878903002: Use injection and remove ozone dependency from ui/display (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unique_ptr Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « ash/shell.cc ('k') | extensions/shell/browser/DEPS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ash/shell.cc ('k') | extensions/shell/browser/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698