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

Side by Side Diff: content/renderer/gpu/render_widget_compositor.cc

Issue 363383002: Forward input tasks to the Blink scheduler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup. DefaultMainThreadTaskRunner now dispatches properly. Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/renderer/gpu/render_widget_compositor.h" 5 #include "content/renderer/gpu/render_widget_compositor.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <string> 8 #include <string>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/strings/string_number_conversions.h" 12 #include "base/strings/string_number_conversions.h"
13 #include "base/synchronization/lock.h" 13 #include "base/synchronization/lock.h"
14 #include "base/sys_info.h" 14 #include "base/sys_info.h"
15 #include "base/time/time.h" 15 #include "base/time/time.h"
16 #include "base/values.h" 16 #include "base/values.h"
17 #include "cc/base/latency_info_swap_promise.h" 17 #include "cc/base/latency_info_swap_promise.h"
18 #include "cc/base/latency_info_swap_promise_monitor.h" 18 #include "cc/base/latency_info_swap_promise_monitor.h"
19 #include "cc/base/switches.h" 19 #include "cc/base/switches.h"
20 #include "cc/debug/layer_tree_debug_state.h" 20 #include "cc/debug/layer_tree_debug_state.h"
21 #include "cc/debug/micro_benchmark.h" 21 #include "cc/debug/micro_benchmark.h"
22 #include "cc/input/layer_selection_bound.h" 22 #include "cc/input/layer_selection_bound.h"
23 #include "cc/layers/layer.h" 23 #include "cc/layers/layer.h"
24 #include "cc/output/copy_output_request.h" 24 #include "cc/output/copy_output_request.h"
25 #include "cc/output/copy_output_result.h" 25 #include "cc/output/copy_output_result.h"
26 #include "cc/resources/single_release_callback.h" 26 #include "cc/resources/single_release_callback.h"
27 #include "cc/trees/layer_tree_host.h" 27 #include "cc/trees/layer_tree_host.h"
28 #include "cc/trees/main_thread_task_runner.h"
28 #include "content/child/child_shared_bitmap_manager.h" 29 #include "content/child/child_shared_bitmap_manager.h"
29 #include "content/common/content_switches_internal.h" 30 #include "content/common/content_switches_internal.h"
30 #include "content/common/gpu/client/context_provider_command_buffer.h" 31 #include "content/common/gpu/client/context_provider_command_buffer.h"
31 #include "content/public/common/content_switches.h" 32 #include "content/public/common/content_switches.h"
32 #include "content/renderer/compositor_bindings/web_layer_impl.h" 33 #include "content/renderer/compositor_bindings/web_layer_impl.h"
33 #include "content/renderer/input/input_handler_manager.h" 34 #include "content/renderer/input/input_handler_manager.h"
34 #include "content/renderer/render_thread_impl.h" 35 #include "content/renderer/render_thread_impl.h"
35 #include "gpu/command_buffer/client/gles2_interface.h" 36 #include "gpu/command_buffer/client/gles2_interface.h"
36 #include "third_party/WebKit/public/platform/WebCompositeAndReadbackAsyncCallbac k.h" 37 #include "third_party/WebKit/public/platform/WebCompositeAndReadbackAsyncCallbac k.h"
38 #include "third_party/WebKit/public/platform/WebScheduler.h"
37 #include "third_party/WebKit/public/platform/WebSelectionBound.h" 39 #include "third_party/WebKit/public/platform/WebSelectionBound.h"
38 #include "third_party/WebKit/public/platform/WebSize.h" 40 #include "third_party/WebKit/public/platform/WebSize.h"
39 #include "third_party/WebKit/public/web/WebWidget.h" 41 #include "third_party/WebKit/public/web/WebWidget.h"
42
40 #include "ui/gfx/frame_time.h" 43 #include "ui/gfx/frame_time.h"
41 #include "ui/gl/gl_switches.h" 44 #include "ui/gl/gl_switches.h"
42 #include "ui/native_theme/native_theme_switches.h" 45 #include "ui/native_theme/native_theme_switches.h"
43 46
44 #if defined(OS_ANDROID) 47 #if defined(OS_ANDROID)
45 #include "content/renderer/android/synchronous_compositor_factory.h" 48 #include "content/renderer/android/synchronous_compositor_factory.h"
46 #include "ui/gfx/android/device_display_info.h" 49 #include "ui/gfx/android/device_display_info.h"
47 #endif 50 #endif
48 51
49 namespace base { 52 namespace base {
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 RenderThreadImpl* render_thread = RenderThreadImpl::current(); 521 RenderThreadImpl* render_thread = RenderThreadImpl::current();
519 cc::SharedBitmapManager* shared_bitmap_manager = NULL; 522 cc::SharedBitmapManager* shared_bitmap_manager = NULL;
520 // render_thread may be NULL in tests. 523 // render_thread may be NULL in tests.
521 if (render_thread) { 524 if (render_thread) {
522 compositor_message_loop_proxy = 525 compositor_message_loop_proxy =
523 render_thread->compositor_message_loop_proxy(); 526 render_thread->compositor_message_loop_proxy();
524 shared_bitmap_manager = render_thread->shared_bitmap_manager(); 527 shared_bitmap_manager = render_thread->shared_bitmap_manager();
525 } 528 }
526 if (compositor_message_loop_proxy.get()) { 529 if (compositor_message_loop_proxy.get()) {
527 layer_tree_host_ = cc::LayerTreeHost::CreateThreaded( 530 layer_tree_host_ = cc::LayerTreeHost::CreateThreaded(
528 this, shared_bitmap_manager, settings, compositor_message_loop_proxy); 531 this, shared_bitmap_manager, settings,
532 render_thread->main_thread_task_runner(),
533 compositor_message_loop_proxy);
529 } else { 534 } else {
530 layer_tree_host_ = cc::LayerTreeHost::CreateSingleThreaded( 535 layer_tree_host_ = cc::LayerTreeHost::CreateSingleThreaded(
531 this, this, shared_bitmap_manager, settings); 536 this, this, shared_bitmap_manager, settings,
537 render_thread->main_thread_task_runner());
532 } 538 }
533 DCHECK(layer_tree_host_); 539 DCHECK(layer_tree_host_);
534 } 540 }
535 541
536 void RenderWidgetCompositor::setSurfaceReady() { 542 void RenderWidgetCompositor::setSurfaceReady() {
537 layer_tree_host_->SetLayerTreeHostClientReady(); 543 layer_tree_host_->SetLayerTreeHostClientReady();
538 } 544 }
539 545
540 void RenderWidgetCompositor::setRootLayer(const blink::WebLayer& layer) { 546 void RenderWidgetCompositor::setRootLayer(const blink::WebLayer& layer) {
541 layer_tree_host_->SetRootLayer( 547 layer_tree_host_->SetRootLayer(
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 widget_->OnSwapBuffersAborted(); 808 widget_->OnSwapBuffersAborted();
803 } 809 }
804 810
805 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { 811 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() {
806 cc::ContextProvider* provider = 812 cc::ContextProvider* provider =
807 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); 813 RenderThreadImpl::current()->SharedMainThreadContextProvider().get();
808 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); 814 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM();
809 } 815 }
810 816
811 } // namespace content 817 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698