| OLD | NEW |
| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/location.h" | 13 #include "base/location.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/numerics/safe_conversions.h" | 15 #include "base/numerics/safe_conversions.h" |
| 16 #include "base/single_thread_task_runner.h" | 16 #include "base/single_thread_task_runner.h" |
| 17 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" |
| 18 #include "base/synchronization/lock.h" | 18 #include "base/synchronization/lock.h" |
| 19 #include "base/sys_info.h" | 19 #include "base/sys_info.h" |
| 20 #include "base/thread_task_runner_handle.h" | 20 #include "base/thread_task_runner_handle.h" |
| 21 #include "base/time/time.h" | 21 #include "base/time/time.h" |
| 22 #include "base/values.h" | 22 #include "base/values.h" |
| 23 #include "build/build_config.h" | 23 #include "build/build_config.h" |
| 24 #include "cc/animation/animation_host.h" | 24 #include "cc/animation/animation_host.h" |
| 25 #include "cc/animation/animation_timeline.h" | 25 #include "cc/animation/animation_timeline.h" |
| 26 #include "cc/animation/layer_tree_mutator.h" |
| 26 #include "cc/base/switches.h" | 27 #include "cc/base/switches.h" |
| 27 #include "cc/blink/web_compositor_animation_timeline_impl.h" | 28 #include "cc/blink/web_compositor_animation_timeline_impl.h" |
| 28 #include "cc/blink/web_layer_impl.h" | 29 #include "cc/blink/web_layer_impl.h" |
| 29 #include "cc/debug/layer_tree_debug_state.h" | 30 #include "cc/debug/layer_tree_debug_state.h" |
| 30 #include "cc/debug/micro_benchmark.h" | 31 #include "cc/debug/micro_benchmark.h" |
| 31 #include "cc/input/layer_selection_bound.h" | 32 #include "cc/input/layer_selection_bound.h" |
| 32 #include "cc/layers/layer.h" | 33 #include "cc/layers/layer.h" |
| 33 #include "cc/output/begin_frame_args.h" | 34 #include "cc/output/begin_frame_args.h" |
| 34 #include "cc/output/copy_output_request.h" | 35 #include "cc/output/copy_output_request.h" |
| 35 #include "cc/output/copy_output_result.h" | 36 #include "cc/output/copy_output_result.h" |
| 36 #include "cc/output/latency_info_swap_promise.h" | 37 #include "cc/output/latency_info_swap_promise.h" |
| 37 #include "cc/output/swap_promise.h" | 38 #include "cc/output/swap_promise.h" |
| 38 #include "cc/proto/compositor_message.pb.h" | 39 #include "cc/proto/compositor_message.pb.h" |
| 39 #include "cc/resources/single_release_callback.h" | 40 #include "cc/resources/single_release_callback.h" |
| 40 #include "cc/scheduler/begin_frame_source.h" | 41 #include "cc/scheduler/begin_frame_source.h" |
| 41 #include "cc/trees/latency_info_swap_promise_monitor.h" | 42 #include "cc/trees/latency_info_swap_promise_monitor.h" |
| 42 #include "cc/trees/layer_tree_host.h" | 43 #include "cc/trees/layer_tree_host.h" |
| 43 #include "cc/trees/remote_proto_channel.h" | 44 #include "cc/trees/remote_proto_channel.h" |
| 44 #include "components/scheduler/renderer/renderer_scheduler.h" | 45 #include "components/scheduler/renderer/renderer_scheduler.h" |
| 45 #include "content/common/content_switches_internal.h" | 46 #include "content/common/content_switches_internal.h" |
| 46 #include "content/common/gpu/client/context_provider_command_buffer.h" | 47 #include "content/common/gpu/client/context_provider_command_buffer.h" |
| 47 #include "content/public/common/content_switches.h" | 48 #include "content/public/common/content_switches.h" |
| 48 #include "content/renderer/gpu/render_widget_compositor_delegate.h" | 49 #include "content/renderer/gpu/render_widget_compositor_delegate.h" |
| 49 #include "content/renderer/input/input_handler_manager.h" | 50 #include "content/renderer/input/input_handler_manager.h" |
| 50 #include "gpu/command_buffer/client/gles2_interface.h" | 51 #include "gpu/command_buffer/client/gles2_interface.h" |
| 51 #include "gpu/command_buffer/service/gpu_switches.h" | 52 #include "gpu/command_buffer/service/gpu_switches.h" |
| 52 #include "third_party/WebKit/public/platform/WebCompositeAndReadbackAsyncCallbac
k.h" | 53 #include "third_party/WebKit/public/platform/WebCompositeAndReadbackAsyncCallbac
k.h" |
| 54 #include "third_party/WebKit/public/platform/WebCompositorMutatorClient.h" |
| 53 #include "third_party/WebKit/public/platform/WebLayoutAndPaintAsyncCallback.h" | 55 #include "third_party/WebKit/public/platform/WebLayoutAndPaintAsyncCallback.h" |
| 54 #include "third_party/WebKit/public/platform/WebSize.h" | 56 #include "third_party/WebKit/public/platform/WebSize.h" |
| 55 #include "third_party/WebKit/public/web/WebKit.h" | 57 #include "third_party/WebKit/public/web/WebKit.h" |
| 56 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 58 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
| 57 #include "third_party/WebKit/public/web/WebSelection.h" | 59 #include "third_party/WebKit/public/web/WebSelection.h" |
| 58 #include "ui/gl/gl_switches.h" | 60 #include "ui/gl/gl_switches.h" |
| 59 #include "ui/native_theme/native_theme_switches.h" | 61 #include "ui/native_theme/native_theme_switches.h" |
| 60 | 62 |
| 61 #if defined(OS_ANDROID) | 63 #if defined(OS_ANDROID) |
| 62 #include "base/android/build_info.h" | 64 #include "base/android/build_info.h" |
| (...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 839 } | 841 } |
| 840 | 842 |
| 841 void RenderWidgetCompositor::setShowScrollBottleneckRects(bool show) { | 843 void RenderWidgetCompositor::setShowScrollBottleneckRects(bool show) { |
| 842 cc::LayerTreeDebugState debug_state = layer_tree_host_->debug_state(); | 844 cc::LayerTreeDebugState debug_state = layer_tree_host_->debug_state(); |
| 843 debug_state.show_touch_event_handler_rects = show; | 845 debug_state.show_touch_event_handler_rects = show; |
| 844 debug_state.show_wheel_event_handler_rects = show; | 846 debug_state.show_wheel_event_handler_rects = show; |
| 845 debug_state.show_non_fast_scrollable_rects = show; | 847 debug_state.show_non_fast_scrollable_rects = show; |
| 846 layer_tree_host_->SetDebugState(debug_state); | 848 layer_tree_host_->SetDebugState(debug_state); |
| 847 } | 849 } |
| 848 | 850 |
| 851 void RenderWidgetCompositor::setMutatorClient( |
| 852 blink::WebCompositorMutatorClient* client) { |
| 853 TRACE_EVENT0("compositor-worker", "RenderWidgetCompositor::setMutatorClient"); |
| 854 layer_tree_host_->SetLayerTreeMutator(client); |
| 855 } |
| 856 |
| 849 void RenderWidgetCompositor::updateTopControlsState( | 857 void RenderWidgetCompositor::updateTopControlsState( |
| 850 WebTopControlsState constraints, | 858 WebTopControlsState constraints, |
| 851 WebTopControlsState current, | 859 WebTopControlsState current, |
| 852 bool animate) { | 860 bool animate) { |
| 853 layer_tree_host_->UpdateTopControlsState(ConvertTopControlsState(constraints), | 861 layer_tree_host_->UpdateTopControlsState(ConvertTopControlsState(constraints), |
| 854 ConvertTopControlsState(current), | 862 ConvertTopControlsState(current), |
| 855 animate); | 863 animate); |
| 856 } | 864 } |
| 857 | 865 |
| 858 void RenderWidgetCompositor::setTopControlsHeight(float height, bool shrink) { | 866 void RenderWidgetCompositor::setTopControlsHeight(float height, bool shrink) { |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1105 #endif | 1113 #endif |
| 1106 return actual; | 1114 return actual; |
| 1107 } | 1115 } |
| 1108 | 1116 |
| 1109 void RenderWidgetCompositor::SetPaintedDeviceScaleFactor( | 1117 void RenderWidgetCompositor::SetPaintedDeviceScaleFactor( |
| 1110 float device_scale) { | 1118 float device_scale) { |
| 1111 layer_tree_host_->SetPaintedDeviceScaleFactor(device_scale); | 1119 layer_tree_host_->SetPaintedDeviceScaleFactor(device_scale); |
| 1112 } | 1120 } |
| 1113 | 1121 |
| 1114 } // namespace content | 1122 } // namespace content |
| OLD | NEW |